src/ManageConnections.c
/*
 * FUNCTION NAME: changeDistance
 *
 * DESCRIPTION:
 * Function changes a distance between city1 and city2.
 */
FUNCTION NAME: changeDistance
DESCRIPTION:
Function changes a distance between city1 and city2.
FUNCTION NAME : changeDistance DESCRIPTION : Function changes a distance between city1 and city2 .
void changeDistance(Graph_t* graph, const char* city1, const char* city2, double distance)
{
    AdjacencyList_t* upper;
    AdjacencyListNode_t* lower;
    for (upper = graph->head; upper != NULL; upper = upper->next) {
        if (strcmp(city1, upper->from) == 0) {
            for (lower = upper->head; lower != NULL; lower = lower->next) {
                if (strcmp(city2, lower->to) == 0) {
                    lower->distance = distance;
                }
            }
        } else if (strcmp(city2, upper->from) == 0) {
            for (lower = upper->head; lower != NULL; lower = lower->next) {
                if (strcmp(city1, lower->to) == 0) {
                    lower->distance = distance;
                }
            }
        }
    }
}
void changeDistance ( Graph_t * graph , const char * city1 , const char * city2 , double distance ) { AdjacencyList_t * upper ; AdjacencyListNode_t * lower ; for ( upper = graph -> head ; upper != NULL ; upper = upper -> next ) { if ( strcmp ( city1 , upper -> from ) == 0 ) { for ( lower = upper -> head ; lower != NULL ; lower = lower -> next ) { if ( strcmp ( city2 , lower -> to ) == 0 ) { lower -> distance = distance ; } } } else if ( strcmp ( city2 , upper -> from ) == 0 ) { for ( lower = upper -> head ; lower != NULL ; lower = lower -> next ) { if ( strcmp ( city1 , lower -> to ) == 0 ) { lower -> distance = distance ; } } } } }
FUNCTION NAME: changeDistance
 DESCRIPTION:
 Function changes a distance between city1 and city2.
FUNCTION NAME : changeDistance DESCRIPTION : Function changes a distance between city1 and city2 .