EduCSE Blog

Share

Graph Class in JavaScript

Author: Win Aung Cho
Javascript-Graph-Class
Graph class implementing several algorythm such as DFS, BFS, DIJKSTRA and PRIM.

Graph is implemented using javascript associative array. Associative array represented adjacency list. Basic algorythms are prototyped and usage can be seen in example html file. HTML Canvas is drawn to show directed graph with nodes and arrowed edges. Some drawing primatives are also included for canvas drawing. Arbitrary associative array can be used as nodal property and edge's property without modifying origional Graph class. Node property array must include location and edge property need value. User may add any other properties.

javascript sourcecode

Directed Graph and Algorythm
Download Source Javascript Class
Source

Original Post


Author: Win Aung Cho
15-Mar-2022 09:57:22 AM*