wiki:AboutTheExamples

Cgc examples

There are several examples in the examples subdirectory. They demonstrate the use of each of the containers, as well as each of the algorithms.

Simple::

Simple construction of a graph with just a few nodes and arcs.

SimpleShortestPath::

This is a simple example that tests the network as well as the simple algorithm to solve the Shortest Path problem in a directed acyclic network.

PathFindExample::

This is a little more complex, but not overwhelming. There are 3 main points to this example:

  • Demonstrate the use of the PathFind? algorithm
  • Demonstrate having "empty data" on the graph thus reducing ram consumption
  • Demonstrate the use of a DynNet? and a destructive example of removing a node on the fly

SSPSolver::

This is a comprehensive example showing much more complex usage of the graph

  • More complex data storage on nodes
  • More complex data storea on arcs
  • Implements a 'well known' algorithm for solving min cost network flow problems (Successive Shortest Paths) There is a reference in the code to the source of the algorithm.

For more detailed code information see the doxygen generated comments for more information on the particular classes. In particular, peruse the "Public Interface" module comments.

Last modified 12 years ago Last modified on Nov 4, 2006 1:26:21 PM