src/GraphCreation.c
/*
 * FUNCTION NAME: graphCreation
 *
 * DESCRIPTION:
 * Main task of this function is to create a graph that will be
 * passed to Dijkstra's algorithm function. Firstly, it gets the number
 * of adjacency lists and allocates memory for it.
 * Then adds edges to the adjacency lists.
 *
 * RETURNS:
 * graph - created list of adjacency lists.
 */
FUNCTION NAME: graphCreation
DESCRIPTION:
Main task of this function is to create a graph that will be
passed to Dijkstra's algorithm function. Firstly, it gets the number
of adjacency lists and allocates memory for it.
Then adds edges to the adjacency lists.

created list of adjacency lists.
FUNCTION NAME : graphCreation DESCRIPTION : Main task of this function is to create a graph that will be passed to Dijkstra ' s algorithm function . Firstly it gets the number of adjacency lists and allocates memory for it . Then adds edges to the adjacency lists . created list of adjacency lists .
Graph_t* graphCreation(void)
{
    Graph_t* graph; 
    ConnectionsList_t connections_list; 
    UniqueCitiesList_t unique_cities_list; 
    graph = createGraph();
    connections_list.head = NULL;
    unique_cities_list.head = NULL;
    createLists(&connections_list, &unique_cities_list);
    if (unique_cities_list.head != NULL) {
        addEdgesToGraph(graph, connections_list, &unique_cities_list);
        removeUniqueCitiesList(&unique_cities_list);
    }
    removeConnectionsList(&connections_list);
    return graph;
}
Graph_t * graphCreation ( void ) { Graph_t * graph ; ConnectionsList_t connections_list ; UniqueCitiesList_t unique_cities_list ; graph = createGraph ( ) ; connections_list . head = NULL ; unique_cities_list . head = NULL ; createLists ( & connections_list , & unique_cities_list ) ; if ( unique_cities_list . head != NULL ) { addEdgesToGraph ( graph , connections_list , & unique_cities_list ) ; removeUniqueCitiesList ( & unique_cities_list ) ; } removeConnectionsList ( & connections_list ) ; return graph ; }
FUNCTION NAME: graphCreation
 DESCRIPTION:
 Main task of this function is to create a graph that will be
 passed to Dijkstra's algorithm function.
FUNCTION NAME : graphCreation DESCRIPTION : Main task of this function is to create a graph that will be passed to Dijkstra ' s algorithm function .
/* Graph that contains all edges and vertices. */ /* Singly linked list contains every connection from DataBase.txt. */ /* Singly linked list that contains every unique city. */ /* Allocate memory for graph and set initial values
     * of lists to NULL. */ /* Now fill unique_cities_list and connections_list with proper data.
     * Cities from unique_cities_list will create nodes
     * for adjacency lists. Then add edges to the adjacency lists'
     * nodes. */ /* If DataBase.txt is correctly filled... */ /* Free the memory and return created graph. */