Created
June 28, 2016 21:24
-
-
Save burdenless/5703abb9be27b31a628aa3cfdbe5f472 to your computer and use it in GitHub Desktop.
Implementing Graph Theory in JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var edgeList = [ [0, 2], [1, 3], [2, 3], [2, 4], [3, 5], [4, 5] ]; | |
var adjMatrix = [ | |
/*0*/[0, 0, 1, 0, 0, 0], | |
/*1*/[0, 0, 0, 1, 0, 0], | |
/*2*/[0, 0, 0, 1, 1, 0], | |
/*3*/[0, 0, 0, 0, 0, 1], | |
/*4*/[0, 0, 0, 0, 0, 1], | |
/*5*/[0, 0, 0, 0, 0, 0] | |
]; | |
var adjList = [ | |
/*0*/[2], | |
/*1*/[3], | |
/*2*/[3, 4], | |
/*3*/[5], | |
/*4*/[5], | |
/*5*/[] | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment