Skip to content

Instantly share code, notes, and snippets.

@laran
Last active September 29, 2018 22:52
Show Gist options
  • Save laran/56a9ed73d220dbeccfe47aa4adf88edd to your computer and use it in GitHub Desktop.
Save laran/56a9ed73d220dbeccfe47aa4adf88edd to your computer and use it in GitHub Desktop.
An Edge List representation of a Graph
// Each element in the Array represents an Edge between the two Nodes with the IDs in that element.
// Every element in the array will have exactly two values.
// The indices of the elements in either the inner our outer Arrays have no meaning.
let graph = [[1, 2], [0, 3], [1, 3], [2, 0]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment