package com.neco4j.graph;

/**
 * Main class to test
 * @author Necati Kartal
 */
public class Main {

	/**
	 * Main function to test
	 */
	public static void main(String[] args) {
		
		// Do test here.
		
		// create graph
		Graph gr = new Graph();
		
		// add vertices
		gr.addVertex("1",40);
        gr.addVertex("2",70);
        gr.addVertex("3",100);
        gr.addVertex("4",10);
		
		// add edges
        gr.addEdge("1", "2"); 
        gr.addEdge("1", "3");      
        gr.addEdge("1", "4");
                
        gr.addEdge("2", "3");     
        gr.addEdge("2", "4");
        
        gr.addEdge("3", "1");
        gr.addEdge("3", "1");
        gr.addEdge("3", "1");
        
        gr.addEdge("4", "3");
        
        // print the graph
        gr.printGraph();
        
        // DFS by using vertex 4
        gr.DFS("4");
        
        // BSF by using vertex 2
        gr.BFS("2");
	}
}
@@ -173,25 +173,24 @@
  args) %7B%0A%09%09%0A
-%09
 %09// Do test 
@@ -194,25 +194,24 @@
 st here.%0A%09%09%0A
-%09
 %09// create g
@@ -215,17 +215,16 @@
 e graph%0A
-%09
 %09Graph g
@@ -239,25 +239,24 @@
 Graph();%0A%09%09%0A
-%09
 %09// add vert
@@ -260,17 +260,16 @@
 ertices%0A
-%09
 %09gr.addV
@@ -377,17 +377,16 @@
 10);%0A%09%09%0A
-%09
 %09// add 
@@ -455,135 +455,40 @@
 3%22);
-      %0A        gr.addEdge(%221%22, %224%22);%0A                %0A        gr.addEdge(%222%22, %223%22);     %0A        gr.addEdge(%222
+%0A%0A        gr.addEdge(%223
 %22, %22
-4
+2
 %22);%0A
-        
 %0A   
@@ -496,33 +496,33 @@
     gr.addEdge(%22
-3
+4
 %22, %221%22);%0A       
@@ -518,77 +518,8 @@
 %22);%0A
-        gr.addEdge(%223%22, %221%22);%0A        gr.addEdge(%223%22, %221%22);%0A        %0A
     
@@ -535,25 +535,25 @@
 dEdge(%224%22, %22
-3
+2
 %22);%0A        

update test data