Skip to content

Dijkstra

Madita Antonia Plogsties edited this page Mar 31, 2025 · 8 revisions

Visual configuration (dijkstra/config.ts)

The extions of the Interfaces IVisualisationState, BasicGraphNodeRS and BasicGraphLinkRS (the node and edge types to communicate with the "backend" in the Adapter) are located here. For the dijkstra configuration two custom attributes were added to nodes: dist, distance to starting node as discovered by the dijkstra algorithm - and - pred, the node from which the shortes path to the current node was discovered.

This file also includes IDijkstraConfig. It currently only defines the colors used in the graph visualizer.

randomDefaults (dijkstra/config.ts)

For the creation of a random graph the getRandomGraph function is used (in src/utils/graphGenerators.ts). Random graph generation is based on Erdős–Rényi model (each edge has a fixed probability of being present or absent, this probability is the density set in generalGraphOptionsDefaults in the same file).

Clone this wiki locally