public void createGraph()
{
Random generator= new Random();
Random cost_generator= new Random();
int vertex1,vertex2,edge_cost;
int edge_count=0;
boolean b[][] = new boolean[no_of_vertices][no_of_vertices];

adjecency_list= new Vertex[no_of_vertices];
for(int i=0;i<no_of_vertices;i++)
{
adjecency_list[i]=new Vertex(i,null,false);
}
vertex1=generator.nextInt(no_of_vertices);
vertex2= generator.nextInt(no_of_vertices);
while(vertex1==vertex2)
{
vertex2= generator.nextInt(no_of_vertices);
}
edge_cost=cost_generator.nextInt(1000)+1;
if(!b[vertex1][vertex2] && !b[vertex2][vertex1])
{
adjecency_list[vertex1].adjList= new Edge(vertex2, edge_cost,adjecency_list[vertex1].adjList);
adjecency_list[vertex2].adjList= new Edge(vertex1,edge_cost,adjecency_list[vertex2].adjList);
b[vertex1][vertex2]=true;
b[vertex2][vertex1]=true;
edge_count++;
}

while( edge_count<no_of_edges || !depthFisrtSearch(this))
{
vertex1=generator.nextInt(no_of_vertices);
vertex2= generator.nextInt(no_of_vertices);
while(vertex1==vertex2)
{

vertex2= generator.nextInt(no_of_vertices);
}
edge_cost=cost_generator.nextInt(1000)+1;
if(!b[vertex1][vertex2] && !b[vertex2][vertex1])
{
adjecency_list[vertex1].adjList= new Edge(vertex2, edge_cost,adjecency_list[vertex1].adjList);
adjecency_list[vertex2].adjList= new Edge(vertex1,edge_cost,adjecency_list[vertex2].adjList);
b[vertex1][vertex2]=true;
b[vertex2][vertex1]=true;
edge_count++;
}

}
System.out.println("No of Nodes:"+no_of_vertices+" Density:"+density+" No of Edges:"+edge_count);
// print();

}