The repository includes runnable examples under examples/.
Each example writes its outputs to a local output/ directory.
If you are new to graphot, use this order:
- two-node benchmark
- cycle transport
- directed reversible transport
- line chain transport
- large-grid transport
This goes from simplest to most demanding.
Path:
examples/two_node_benchmark/run.py
Use it for:
- a first successful run,
- checking the reported distance against a known reference,
- understanding the meaning of
rhoandmon the smallest possible graph.
Path:
examples/cycle_neighbor_transport/run.py
Use it for:
- seeing how mass chooses between nearby routes,
- understanding the qualitative shape of a transport path on a small graph.
Path:
examples/line_chain_transport/run.py
Use it for:
- simple path-graph transport,
- inspecting how mass moves along a one-dimensional graph.
Path:
examples/directed_reversible_transport/run.py
Use it for:
- examples where the graph is directed but still reversible,
- learning when
GraphSpec.from_directed_rates(...)is appropriate.
Path:
examples/large_grid_transport/run.py
Use it for:
- testing the solver on a larger problem,
- generating richer plots,
- exploring debug traces on harder cases,
- comparing large-solver settings and continuation schedules on the
32x32setup.
This is the most demanding example in the repository.
After installing the optional plotting dependencies, run scripts from the repo root with:
python examples/two_node_benchmark/run.py
python examples/cycle_neighbor_transport/run.py
python examples/line_chain_transport/run.py
python examples/directed_reversible_transport/run.py
python examples/large_grid_transport/run.pyIf your build includes OpenMP, the examples use all available CPU threads by default. To run with a different thread count, prefix the command with an environment variable:
GRAPHOT_NUM_THREADS=16 python examples/large_grid_transport/run.pyOMP_NUM_THREADS=16 ... also works if you already manage OpenMP that way.
Most example scripts write:
- a saved state file,
- a node plot,
- an edge-flow plot,
- a graph snapshot.
The large-grid example saves debug traces by default. Use --no-debug-trace
if you want to skip them.