
#define MAX_CITIES 100 
#define MAX_TOUR_LENGTH 1000

/*============================ node ==========================*/
/* One node is created for each city.                         */
/* The node is linked to a halfEdge which contains a pointer  */
/* to a city connected to this node, the cost of that edge,   */
/* and a pointer to the next city connected to this node.     */
/* edgeCount is incremented each time a halfEdge is added.    */
/* It is useful to have this count when generating a ramdom   */
/* genome.                                                    */
/* The life of a node, is the life of the program: nodes are  */
/* created when the data file is read, are never changed, are */
/* never deleted and are used until the program ends.         */
struct node 
{ char *name;
  struct halfEdge *next;
  int edgeCount;
};



/*=========================== halfEdge =======================*/
/* This struct is called a halfEdge because it only contains  */
/* a destination city. Thus, a halfEdge by itself is          */
/* meaningless.                                               */
/* The halfEdges are connected in a chain that always starts  */
/* at a node. That node is the city of orgin for every        */
/* halfEdge in the chain.                                     */
/* The life of a halfEdge, is the life of the program:        */
/* created when the data file is read, never change, never    */
/* deleted and are used until the program ends.               */
struct halfEdge 
{ struct node *city;
  int cost; 
  struct halfEdge *next;
};



/*=========================== genome ===========================*/
/* A genome is a full tour of all nodes.                        */
/* Each node must be included at least once.                    */
/* The genome must start at the starting city and end at the    */
/* ending city.                                                 */
/* The cost of a gemome is the sum of each cost of each edge    */
/* The popluation is an array of genomes.                       */
/* To make this simpler, let a genome have a maximium length.   */
/* That way we can let a genome be an ordered array of nodes.   */
/* The minimum length of a genome is the number of node: each   */
/* node visited exactally once. Thus, a maximium genome length  */
/* of 10x the number of nodes would be plenty of space.         */ 
/* The gene array is ordered with gene[0] being the start city  */
/* and gene[length-1] being the end city.                       */
struct genome 
{ int cost;       //sum of all edges.
  int length;     //Number of nodes (citys) in the tour.
  struct node *gene[MAX_TOUR_LENGTH];
};

