Skip to content

A social network graph application that reads user data from a file and provides functionalities to view a user's friends list and check the connection path between two users. It uses a file reader to load data, a Record class to store user info, and a PathFinder class to determine the shortest path using BFS.

Notifications You must be signed in to change notification settings

AhStayinAlive/-Social-Network-Graph-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social-Network-Graph-Application

A social network graph application that reads user data from a file and provides functionalities to view a user's friends list and check the connection path between two users. It uses a file reader to load data, a Record class to store user info, and a PathFinder class to determine the shortest path using BFS.

INSTRUCTIONS Social Network Graph Application This application simulates a social network graph, where users can check their friends list and find connections between any two users.

Compile the Code

  • javac Main.java FileReader.java Record.java PathFinder.java

Run the Application

  • java Main

Follow the On-screen Prompts

  • Input the file path containing user data (Trinity100 or Harvard1)
  • Choose options from the main menu to interact with the application.

File Format

The input file should follow the format:

  • First line: Total number of users and total number of connections.
  • Subsequent lines: Pairs of user IDs representing connections.

-Example:

5 4

Main Menu Options

Get Friend List

  • Enter a user ID to see the list of friends for that user.

Get Connection

  • Enter two user IDs to see the connection path between them if it exists.

Example Session

  • Get Friend List

Enter ID of person: 1 Person 1 has 2 friends! List of friends: [0, 2]

  • Get Connection

Enter ID of person A: 0

Enter ID of person B: 3

There is a connection from 0 to 3!

0 is friends with 1 1 is friends with 2 2 is friends with 3

About

A social network graph application that reads user data from a file and provides functionalities to view a user's friends list and check the connection path between two users. It uses a file reader to load data, a Record class to store user info, and a PathFinder class to determine the shortest path using BFS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published