You are on page 1of 4

Data Structures

Fall 2010

Project: Graph Project


Assigned 24-Nov-2010
Phase 1Deadline: 01st Dec, 2010, before 1200 hrs
Phase 2 Deadline 8th Dec, 2010, before 1200 hrs

Phase 1:
In Phase 1, you are required to
 User can choose one of the following two options to make the
graph.
o Read a file containing the graph information
o Make Random graph
 Store graph information it in a data structure.
 Display the graph on the Application.

Project Group
Students are allowed to do this project in groups. Maximum size of a group can be at
most two students. Make groups carefully, you will not be allowed to change groups after
submission.

Graph Input
User will select one of the following two methods to input graph.
1. From file
User should be provided an option of selecting a file for graph input by browsing the
computer using file dialog.
The following formats must be strictly followed by all the teams. Any bug in
reading/writing the file will result in a serious penalty of deduction of Marks. This
penalty can be 50% of the total marks. So make sure you read/write on file very carefully.
All lines starting with the symbol @ should be ignored by your program. First line is list
of names of cities. All subsequent lines represent edges in the graph with their weights
e.g. consider following input file.

@ Graph Data
@ Graph Vextexs
[Node1][Node2][Node3]…..[Noden]
@ Graph Edges
[Node1-Node2][Weight]$[Node1-Node4][Weight]$[Node1-
Node5][Weight]
[Node2-Node4][Weight]$[Node4-Node6][Weight]
.....
......
[m-n][Weight]

Example:
[V1][V2][V3][V4]
[V1-V2][2]$[V1-V3][4]$[V1-V4][6]
[V2-V3][5]$[V2-V4][8]
….
….

In the above graph there are four nodes V1, V2, V3 and V4.

2. Random graph
You can choose any one of the following two algorithms can choose for random graph
generation. Number of nodes & the weight range will be provided by the user.
 Edge Number
This generator takes as input the parameters n (number of nodes) and m
(number of edges) and randomly creates a graph with edges uniformly
distributed and independently chosen from the set of all possible edges.
 Edge Density
This random generator take two input parameters n (number of nodes) and a
number ρ is in range from [0,1] that represents the probability of generating
an edge between any two vertices. For each possible edge, ED generates a
random number x is in the range [0,1] and adds the edge to the graph if x < ρ.
3. Graph storage
Graph should be stored in a Link list data structure as well as in Matrix. Your data
structure will be checked with different graph sizes in demo & it should be able to hold
any number of graph sizes.

4. Output
Following are the required outputs from your project Phase1:
 Draw Graph Nodes on the console.
 All of the Nodes must be labeled with Node Name.
 All of the edges should be labeled with the weights
Hint: On screen graphs can be drawn in a circle perimeter.

Phase II:
In Phase 2, you are required to implement the following algorithms
 Seaching
o Breath First Search
o Depth First Search
 Minimum Spanning Tree
o Prim’s Algorithm
o Kruskal’s Algorithm
 Short Path Problem
o Dijkstra’s Algorithm
o Floyd’s Algorithm

5. Submission
Submission Instruction should be followed else marks will be deducted.
 Create a folder like RollNo1_RollNo2_P1
 Create two subfolders with names Sourcecode, Exe.
 Put all source code in the Sourcecode folder.
 Put the Exe of your project in the Exe folder.
 Do not zip the folder.
 Paste this folder in Submit subfolder in course folder. Submission through
emails will not be accepted.
6. Grading
Both group members should know working and implementation details of each part of
project, even it was done by other member. Grading will be done on group basis and as
well as individually.
Demos will be held in my office, and both group members must be present at the time of
demonstration. Any absent group member will get zero marks in the project.
 In case of any ambiguity feel free to contact me or course TAs.
 Start working on project from today, and do not come to my office for
extension in deadline of project. Submission deadline is absolutely final.

You might also like