Data structures & algorithms graphs | data | Harrisburg University of Science and Technology

Assignment 5: Graphs

Family tree’s and genealogy software has become more and more prevalent in recent years. From the name you might expect that a family tree would be easily represented by a tree structure, but that is not the case! A more appropriate data structure to

represent a family tree would be a type of graph. Using the description of the family that accompanies this assignment, you must represent this family using a graph structure. The graph needs to be a weighted graph. The weights will constitute the types of

relationships, I recommend using some kind mapping between numbers and strings to represent the relationships. When adding family members to the graph, this can be done programmatically for the provided family members within the description file.

Additionally, I also want there to be an interface in which a user can create a new family member and add them to the tree. This can be a simple CLI where the user provides a name, gender, and age to create a person. Then another simple CLI where they select

which member of the family they want the original relationship to be with and what kind of relationship it should be. Finally, they can edit the family member using another CLI and selecting the family member they wish to edit, the operation they wish to

perform (edit name, edit age, edit relationship), and then add new relationship between family members which can call a function that you create in order to add the original relationship. Remember the DRY philosophy, where code can be modularized or made

into a function, it should be if you plan on using the logic again.

Finally, I want you to make data assertions within the FamilyTree class that enforce certain “rules” that exist in a typical human family. An example would be a person should not have any kind of relationship to itself (a person can not marry themselves, a person

can not be their own brother, sister, father, mother, etc.). There should be at least 3 data assertions. These should exists as part of the family tree, not as part of the graph.

As a hint, for a successful design: I would recommend using layers of abstraction. Your graph class is the backing structure to the family tree class. Your family tree should implement methods that interface with the graph class, i.e. add_family_member() should

call the constructor to create a node and then call a function within the graph class to add a node to the graph. Then using the relationships function parameter, you can add edges to the graph between the new nodes and the existing nodes. The family tree

should be what enforces what relationships can exist through the data assertions, the graph does not care about what relationships are made between family members. Your functions that the user would interface with would be greatly reduced compared to the

total number of methods within the classes themselves. The user should be able to add, remove, and modify family members and that’s about it. Therefore those should be your function calls.

Submission Goals

(120 pts.) Create a FamilyTree class that will represent a family tree for a given family.

The class should contain several types of relationships that commonly happen within a family (siblings, marriage, offspring, etc.)

(40 pts.) Programmatically add the family members to the graph as described by the accompanying family description file.

(40 pts.) Give data assertions to the FamilyTree class to enforce restrictions for basic family structure (at least 3); i.e A person can not marry themselves.

(40 pts.) Provide a simple CLI the enables users to add, remove, and edit family members.

* Note that there is a total of 240 points on the table here. The assignment is only worth 200 points. You have 40 points of optional goals.

Your

Paper Writing Center
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.