Design and implement a driver program testsocialgraph

Assignment Help JAVA Programming
Reference no: EM131119094

Social Graphs - An Application of Graphs

1. Specification

The concept of Social Graph was introduced by M. Zuckerberg at the first Facebook F8 conference in 2007 when he introduced the Facebook platform to model relationships among internet users.

Part 1

Consider the attached file Graph.java which defines a generic undirected Graph class. Design and implement a class SocialGraph (in a separate source file SocialGraph.java) which extends the class Graph. In a social graph, the vertices (graph nodes) represent people names while the un-directed edges represent the acquaintance relationships between them. Class SocialGraph should define constructor(s) and enhance the behavior of the class Graph by defining the following social graphs' specific methods:

• normalizedDegreeOfCentrality calculates and returns the normalized degree of centrality for a given vertex v. The required value is calculated as: degree(v) / (n-1) where degree(v) represents the number of vertex incident edges and n represents the number of graph vertices. For social graphs, a high degree of centrality for a person v reflects his/her dominant position in the group or his/her social interaction skills.

• numberOfTrianglesIncidentToVertex, calculates and returns the number of triangles incident to vertex v. The algorithm below calculates the number of triangles incident for all graph vertices (V is the set of vertices, E is the set of edges):
foreach v in V foreach pair of vertices (p, q) in AdjacencyList(v) if (p, q) is in E then add 1 to triangles[v]

• listOfTrianglesIncidentToVertex calculates and returns the list of triangles incident to vertex v. A triangle should be specified by its vertices.

• clusterIndividual for a given vertex v, calculates and returns the percentage indicating how close its neighbors are to make a complete graph and is calculated as: [(number of edges connecting v's neighbor vertices) / (number of edges, potentially connecting v's neighbor vertices)] * 100 where: - the number of edges connecting v's neighbor vertices is equal to the number of triangles incident to vertex v - the number of edges, potentially connecting v's neighbor vertices is calculated as: [degree(v) * (degree(v) - 1)] / 2

The value of cluster individual measures how close wrapped are the persons in the social graph around the given person.

• averageClustering for the social graph is calculated as (the sum applies to all vertices v in V): (1 / n) * ∑ clusterIndividual (v) This value indicates the overall density of the social graph.

• isDirectAcquaintance determines whether two persons supplied as parameters are / are not direct connected.

• isIndirectAcquaintance determines whether two persons supplied as parameters can establish social contact through a chain of transitive acquaintance relationships (in terms of graphs it means that there is a path between the two nodes representing the two persons).

Additional (helper) methods and / or instance variables may be defined as necessary.

Part 2

Design and implement a driver program TestSocialGraph (in a separate source file TestSocialGraph.java) for testing the methods implemented in Part 1. The driver program should build a social graph from an input file data.txt. After building the social graph, in a loop, the program should invite the user to select for execution one of the following operations: (1) normalizedDegreeOfCentrality, (2) numberOfTrianglesIncidentToVertex, (3) listOfTrianglesIncidentToVertex, (4) clusterIndividual, (5) averageClustering, (6) isIndirectAcquaintance, (7) isIndirectAcquaintance, (8) addVertex, (9) addEdge, (10) printEdges and (0) exit the loop and the program. As a result of each operation execution, relevant information should be displayed to the user. For example, as a result of invoking clusterIndividual method, the cluster individual value for the given person should be displayed.

An example of the data input file content, its format and the corresponding social graph layout is shown in the attached file SocialGraph_Example.pdf.

The programs should compile without errors.

Notes. 1. You may consider that there are no errors in the input file structure. 2. If an operation requires additional information, the user will be prompted to enter it. 3. The input file (a simple .txt file) should be generated by the students using a simple text editor such as Notepad. 4. Person names (instead of indices) should be used in I/O operations involved by the user interface.

2. Submission Requirements

Submit the following before the due date listed in the Calendar:

1. All .java source files and the input file data.txt. The source code should use Java code conventions and appropriate code layout (white space management and indents) and comments.

2. The solution description document <YourSecondName>_FP (.pdf or .doc / .docx) containing: (2.1) assumptions, main design decisions, error handling, (2.2) test plan, test cases and two relevant screenshots, (2.3) lessons learned and (2.4) possible improvements. The size of the document file (including the screenshots) should be of three pages, single spaced, font size 10.

Attachment:- Java_Homework.zip

Reference no: EM131119094

Questions Cloud

Prepare a consolidated balance sheet for ormond co : Prepare a consolidated balance sheet for Ormond Co. and Daytona Co. on January 1, 2010. Ignore deferred tax effects. Exhibit 7.32 presents income statements and balance sheets taken from the separate-company books at the end of 2010. The following in..
Considering psychopaths : Be sure to read Jennifer Kahn's article "Can You Call a 9-Year Old a Psychopath?" to answer these questions properly: 1.) Overall, based on the article, what appear to be some of the more common characteristics of whatever a "psychopath" is?
Describe the impact of our current digital age : Describe the impact of our current digital age on the concept of self , including the impact of social media on the way we perceive ourselves. Explain whether or not our perceptions of self are evolving because of social media, including the idea ..
Do you think the project should be accepted why : Define payback period. Assume the company has a P/B (payback) policy of not accepting projects with life of over 3 years. Do you think the project should be accepted? Why?
Design and implement a driver program testsocialgraph : Design and implement a driver program TestSocialGraph (in a separate source file TestSocialGraph.java) for testing the methods implemented in Part 1.
Domain-specific and precise language : Domain-specific and precise language make writing more authoritative. If you use words that are less vague it makes it seem like you can get the sentences to make more sense with less detail.
Error corrections and accounting changes penn company : Error Corrections and Accounting Changes Penn Company is in the process of adjusting and correcting its books at the end of 2010. In reviewing its records, the following information is compiled.
Identifies and explains the strong points of the managers : Analyzes the basic legal, social, and economic environment in which the organizations operate
Heaven chapter summary due tonight : Radical Evolution Heaven, 87-106, 112-127 (Please note that you are not required to read the entire chapter, just the pages assigned)

Reviews

Write a Review

JAVA Programming Questions & Answers

  Determine the length of the string

You must give your user three opportunities for wrong input before you terminate the program.

  The program reads in names

Write a program and include the following methods. The program reads in names and ages (use 2 parallel arrays, maximum size 50) from a file called Stuff.dat.

  Feature of object-oriented programming

Use the Internet or Strayer databases to research the advantages, features, and common examples of OOP and EDP. Describe at least one (1) feature of object-oriented programming that Visual Logic lacks

  Project amount of total sales

Write a program called sales_prediction.js, that displays the profit based on the project amount of total sales for the year. Use a literal value of $2,500,000 for the projected total sales amount. Display the profit amount formatted to two decima..

  The array at the index method

have an array, how do i remove an entry from the array at the index method?

  Program obtaining the new scriptdownload and save the

program obtaining the new scriptdownload and save the attached comment cgi mailer script form-mail2.pl to your servers

  Mean and standard deviation write a program that reads a

mean and standard deviation. write a program that reads a set of floating-point data values from the input. when the

  Develop a data type for the time of day

Time. Develop a data type for the time of day. Provide client methods that return the current hour, minute, and second, as well as to String() and compare To() methods. Develop two implementations: one that keeps the time as a single int value (nu..

  How are java source code files named

What is the purpose of the wait(), notify(), and notifyAll() methods? How are Java source code files named?

  I had to call a webservice

I had to call a webservice (1st line of code) and then from there created a loop but keep getting an error every time on the .getBusiness - I don't know what I should be using there instead of getBusiness.

  What are command line arguments in java

Modify the program such that if there are no command line arguments, when you type:

  Subtract the immediate constant

Call a procedure at 5120, stacking the return address Subtract the immediate constant 16 from the stack pointer Compare the actual parameter to the immediate constant 4 Jump if equal to 5152

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd