Class exercise regarding the random generation of connected graphs and their Breadth-First traversal, with benchmarks.
- Haskell
stack
tool.
cd
to project directory;- Run
stack setup
(you only have to do this once); - Run
stack build
.
cd
to project directory;- Run
stack exec graph
.
help
random [scale] [upperbound]
- run random algorithm up toupperbound
withscale
spacingpref [scale] [upperbound]
- run preferencial attachment algorithm up toupperbound
withscale
spacingbfs [pref/random] [nr_of_nodes] [start_node]
- run bfs, starting on start_node, on graph generated with pref/random algorithm composed by nr_of_nodes nodesexit
command:
> pref 10 50
Result:
command:
> bfs pref 0 10
Result:
Step 0
(...)
Final Step
Resulting Tree