Skip to content

Commit

Permalink
Extend the documentation.
Browse files Browse the repository at this point in the history
Add description on how to build the library and run unit tests.
  • Loading branch information
vahancho committed Dec 5, 2023
1 parent 99111a6 commit 771fa3e
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,39 @@ path = graph.shortestPath(1, 6, weightFunction);
// path = {1, 2, 5, 6}
```

## Build and test

In order to build the project please use the following commands:

```bash
cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=True
cmake --build build --config Release
```

To run the unit tests

```bash
ctest -C Release --verbose
```

## Example (California road network)

The `roadmap` example demonstrates how to use `Graphene` library to create a road
map. As an input we used the [California Road Network]
(https://users.cs.utah.edu/~lifeifei/SpatialDataset.htm) which represented by two files:
`/examples/data/nodes_lon_lat.txt` with the nodes' geodetic coordinates and
`/examples/data/edges.txt` file with nodes indexes and distance between them.
map. As an input we used the [California Road Network](https://users.cs.utah.edu/~lifeifei/SpatialDataset.htm)
which represented by two files: `/examples/data/nodes_lon_lat.txt` with the nodes'
geodetic coordinates and `/examples/data/edges.txt` file with nodes indexes and
distance between them.
Using this data we created an undirected graph and use `Graphene::shortestPaths()`
function to find all paths that connect a node with all others. The tool exports
the results as a [KML](https://en.wikipedia.org/wiki/Keyhole_Markup_Language) file
which can be loaded, for example, into Google Earth application for visualization.

The `roadmap` application usage example is:

```bash
./roadmap edges.txt nodes_lon_lat.txt 10000 california_roadmap.kml
```

<img src="./examples/data/california_roadmap.png" alt="California Road Network" width="350">

# See also
Expand Down

0 comments on commit 771fa3e

Please sign in to comment.