Use a standard library (the "STL").Implement a graph representation.Implement an algorithm for path finding in a graph.2. Introduction

You need to write a C + + program that calculates named tp3 minimum distance paths between locations on a map.

Your program must be launched from the command line with the following syntax:./tp3 [filename]where filename is optional.If filename is specified, then your program should read in filename using a flow reading C + + std :: ifstream. Otherwise, your program should read from standard input (stdin) with the input stream C + + std :: cin. Computed paths must be written to the standard output (stdout) using the output stream C + + std :: cout.

A skeleton is available starting in tp3.zip.

3. Input formats and output

3.1 Input

The entry consists of:

* A list of locations. A location is specified by a name and by a coordinate of the form (x, y) where x and y are real numbers.Three dashes (---) separation.* A list of roads. A road is specified by a pair of locations separated by "->" (one-way) or "" (both directions). Note that the direction "> there is at least one white space (space, tab or newline) after each place name.

It is assumed that the roads are straight. Thus, the length of a road is the Euclidean distance between the two places she reads. For example, the length of the road-l0> l1 is 50 units.In tests, the number of requests is less than the square of the number of places (n2). This should give you a clue as to which algorithm to use (or not use).There may be multiple requests from the same place of origin. In this case, these queries may be consecutive.

3.3 Released

Your program must write output paths calculated. A path is specified by the list of places to borrow, separated by a space, and in the order of the route for travel from origin to destination. If there is no path between the origin and destination, must display "!" (See test2.txt). Each path is followed by a newline (\ n).

Here is an example of output (test0.txt.resultat)

a b c d ff a b c d4. Constraints

4.1 Libraries permitted

Use as much as possible, the containers in the standard library of C + + Standard Template Library (). This constraint aims to put into practice the use of a standard library. Obviously, you can create your own structures if necessary. This is necessary when a structured requested is not provided by the STL, or when the structure provided in the STL does not suit your needs. For example, you will likely create a class graph or Map.

Tests are available in tp3-tests.zip. The expected results are available for the first 10 tests.