src/GraphCreation.c
/*
 * FUNCTION NAME: addEdgesToGraph
 *
 * DESCRIPTION:
 * Function adds edges to the graph, i.e. elements of unique_cities_list list
 * will create nodes that will contain heads to adjacency list. Then it will fill adjacency lists
 * with proper cities (in alphabetical order).
 */
FUNCTION NAME: addEdgesToGraph
DESCRIPTION:
Function adds edges to the graph, i.e. elements of unique_cities_list list
will create nodes that will contain heads to adjacency list. Then it will fill adjacency lists
with proper cities (in alphabetical order).
FUNCTION NAME : addEdgesToGraph DESCRIPTION : Function adds edges to the graph i . e . elements of unique_cities_list list will create nodes that will contain heads to adjacency list . Then it will fill adjacency lists with proper cities ( in alphabetical order ) .
void addEdgesToGraph(Graph_t* graph, ConnectionsList_t connections_list, UniqueCitiesList_t* unique_cities_list)
{
    ConnectionsListNode_t* city;
    UniqueCitiesListNode_t* cityList;
    for (cityList = unique_cities_list->head; cityList != NULL; cityList = cityList->next) {
        addAdjacencyList(graph, cityList->city);
        for (city = connections_list.head; city != NULL; city = city->next) {
            if (strcmp(cityList->city, city->from) == 0) {
                addNodeToAdjacencyList(graph->head, city->to, city->distance);
            }
        }
    }
}
void addEdgesToGraph ( Graph_t * graph , ConnectionsList_t connections_list , UniqueCitiesList_t * unique_cities_list ) { ConnectionsListNode_t * city ; UniqueCitiesListNode_t * cityList ; for ( cityList = unique_cities_list -> head ; cityList != NULL ; cityList = cityList -> next ) { addAdjacencyList ( graph , cityList -> city ) ; for ( city = connections_list . head ; city != NULL ; city = city -> next ) { if ( strcmp ( cityList -> city , city -> from ) == 0 ) { addNodeToAdjacencyList ( graph -> head , city -> to , city -> distance ) ; } } } }
FUNCTION NAME: addEdgesToGraph
 DESCRIPTION:
 Function adds edges to the graph, i.e.
FUNCTION NAME : addEdgesToGraph DESCRIPTION : Function adds edges to the graph i . e .
/* First, add a node to the graph (i.e. add a node to the list that
     * contains heads to adjacency lists). Then, if there is a connection from or to this
     * city that is in the node, add edge to the adjacency list.
     *
     * Note: it will add a node to keep adjacency list in alphabetical order. */