Skip to content
Jason Park edited this page May 21, 2016 · 18 revisions

Algorithm Visualizer

Hierarchy of algorithm Directory

Path Description
/algorithm/category.json This file contains the list of categories and their algorithms.
/algorithm/[category]/[algorithm]/desc.json This file contains the description of the algorithm and the list of its examples.
/algorithm/[category]/[algorithm]/[example]/data.js This file predefines data variables that will be shown in a visualizing module.
/algorithm/[category]/[algorithm]/[example]/code.js This file actually implements and visualizes the algorithm.

Visualizing Modules

Creating Random Data

Function Description
Graph.random((Number) N, (Number) ratio) Create random graph data containing N nodes and having edges between nodes at the probability of ratio (between 0 and 1).
WeightedGraph.random((Number) N, (Number) ratio, (Number) min, (Number) max) Basically same as Graph.random but edges have a random weight between min and max.

Clone this wiki locally