forked from techpanja/interviewproblems
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestDG.java
More file actions
30 lines (27 loc) · 791 Bytes
/
TestDG.java
File metadata and controls
30 lines (27 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package graphs.test;
import graphs.graph.DirectedGraph;
import graphs.graph.Graph;
import graphs.graph.Vertex;
/**
* Test class for graphs.
* User: rpanjrath
* Date: 10/24/13
* Time: 6:01 PM
*/
public class TestDG {
public static void main(String[] args) {
Graph graph = new DirectedGraph(10);
Vertex vertex1 = new Vertex("item1");
Vertex vertex2 = new Vertex("item2");
Vertex vertex3 = new Vertex("item2");
graph.addVertex(vertex1);
graph.addVertex(vertex2);
graph.addVertex(vertex3);
graph.addEdge(vertex1, vertex2);
graph.addEdge(vertex1, vertex3);
graph.addEdge(vertex2, vertex3);
graph.displayVertexList();
graph.displayGraphDependency();
graph.topoSortGraph();
}
}