/************************************************************************************************/
/*			        LEDA Lab: 7th Lab Assignment					*/
/*			         DFS Algorithm			 					*/
/************************************************************************************************/

#define WhoAmI " GIVE YOUR NAMES AND A.M."		// for identification purposes		



#include <LEDA/graph/graph.h> 
#include <LEDA/core/queue.h> 
#include <LEDA/core/array.h> 
#include <LEDA/core/string.h>
#include <LEDA/core/d_array.h> // for the dynamic insertion of a graph...
#include <iostream> 
 
using namespace leda; 

using std::cout;
using std::cin;
using std::endl;
  
////////////////////////////////// ZHTHMA 1o: CONSTRUCT GRAPH /////////////////////////////

void construct_graph(	graph &G, 
			node_array<string> &name, 
			edge_array<int> &length) 
{

	d_array<string,node> nametonode;
	d_array<node,string> nodetoname;

// INSERTION OF NODES....
// Use G.new_node();

	///////////////	 PROVIDE YOUR CODE HERE		///////////////	


// INSERTION OF EDGES...
// Use G.new_edge(startnode, endnode);

	///////////////	 PROVIDE YOUR CODE HERE		///////////////	


// ASSIGN NAMES TO NODES...
// Use name[v] = nodetoname[v]...

	///////////////	 PROVIDE YOUR CODE HERE		///////////////	


//ASSIGN LENGTHS TO THE EDGES...
// Use length[e] = edgelength....	

	///////////////	 PROVIDE YOUR CODE HERE		///////////////	

}



////////////////////////////////// ZHTHMA 1o: MYPRINT /////////////////////////////

void myprint( graph &G, 
		node_array<string> &name, 
		edge_array<int> &length )
{

//	MY PRINT FUNCTION...
	cout << endl << endl;
	cout << "PRINTING THE GRAPH WITH MY_PRINT (FORMAT [v]: [v]--{lentgth[vu]}-->[u])" << endl;

	///////////////	 PROVIDE YOUR CODE HERE		///////////////	

}

////////////////////////////////// ZHTHMA 2o: DFS ////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////
//                         Depth First Search (DFS)                              //
///////////////////////////////////////////////////////////////////////////////////

void DFS_visit(	int &stepcounter, 	// keep the steps
		node v, 				// the starting node v
		list<edge> &EDFS, 		// E' for DFS-tree
		const graph &G, 			// graph G
		node_array<int> &dist, 		// distances from root
		const edge_array<int> &length, // length of each edge
		node_array<int> &firstvisit,	// first visits array 
		node_array<int> &lastvisit,	// last visits array
		node_array<node> &p,		// the parent function, p[v]=u
		node_array<int> &color 		// color array 
 		)
{
	edge e;
	node u;

	///////////////	 PROVIDE YOUR CODE HERE		///////////////	
}



void DFS(	list<edge> &EDFS, 		// E' for DFS-tree
		const graph &G, 			// graph G
		node_array<int> &dist , 	// distances from root
		edge_array<int> &length, 	// length of each edge
		node_array<int> &firstvisit, 	// first visits array 
		node_array<int> &lastvisit,   // last visits array
		node_array<node> &p,		// the parent function, p[v]=u
		node s				// rootnode for starting DFS
	)	
{

node_array<int> color(G);	// the color of each node...
int stepcounter = 0;

	///////////////	 PROVIDE YOUR CODE HERE		///////////////	

}






int main() 
{

cout << "///////////////////////////////////////////////////////////////////////////////////////////////////// " << endl;
cout << "LEDA LAB 2012: Lab7 \t DFS Algorithm \t" << WhoAmI << endl;
cout << "///////////////////////////////////////////////////////////////////////////////////////////////////// " << endl;
 
	string s;

	graph G; 
	
	node_array<string> name;

	node_array<int> dist(G,-1); 	// distances from the root of the DFS tree
						// Initially all unreached (encoded by -1)

	edge_array<int> length(G,1); 	// lengths of edges in the graph G...

	node_array<int> firstvisit;	// first visit array

	node_array<int> lastvisit;	// last visit array

	node_array<node> p;		// the parent function, p[v]=u 
	
	list<edge> E;			// the list of DFS Tree edges...

	node v;
	edge e;

	cout << "...GIVING A GRAPH AS INPUT..." << endl; 

	construct_graph(G,name,length); 

	myprint(G,name,length);

	//// DIAVASMA TOU KOMVOU (rootnode) POU XEKINAEI H BFS...
	node rootnode;

	///////////////	 PROVIDE YOUR CODE HERE		///////////////	

} 

