File: README Anthony Towns 8th September 1997 (midnight) Assignment 2 - Shortest Travelling Path The solution to this assignment is divided into the following modules: - cities: defines Australian cities to be considered in the assignment, city pairs, and an array of city names. - bool: definition of the boolean data type. - strlib: library of routines to work with strings as arrays of characters limited to 255 elements. - iotravel: routines to read and display information relating to travel. It also defines a city path array; this definition a logically belongs to the cities module, however, due to assignment restrictions that module could not be changed. - search: routines that implement the search algorithm to find the shortest path between a pair of cities given a flight route map. - travel: main driver program. The following two modules were added for this assignment: - citystk: defines a stack of cityPair values. The stack is implemented as a singly linked list. - citygraph: defines a graph of distances between cities. This is stored in a linked list of distances. The city- Pair (x,y) is treated the same way as (y,x). A citygraph consists of a structure containing a count of the number of nodes in the graph and a pointer to the first node (or NULL if there are no nodes); and each node contains a pair of cities, the distance between them and a pointer to the next node. If the pointer to the next node is NULL, then there is no next node and that is the last node in the list. graphNew() simply allocates and initializes a list structure. graphEmpty() checks whether the number of elements in the list is 0. addCityPairDistance() adds a node containing the given cityPair and distance to the start of the list, incrementing the count of elements. NB: if a cityPair is added twice it _is added twice_ -- ie displayGraphContents() will display the cityPair twice. distanceBetweenCities() checks each node in the list to see if it contains the given cityPair or the reversed cityPair, and if so returns the distance. displayGraphContents() iterates over each node, printing out the names of the cities in the cityPair and the distance between them. graphFree() iterates through the list freeing any allocated memory.