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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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