Skip to content

Dongss/cxx-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Shaoshuai Dong
Apr 9, 2017
3ce7e20 · Apr 9, 2017

History

6 Commits
Apr 9, 2017
Apr 9, 2017
Apr 9, 2017
Apr 7, 2017
Apr 9, 2017
Apr 9, 2017
Apr 9, 2017
Apr 9, 2017
Apr 9, 2017

Repository files navigation

cxx-graph

Topological Sort C++ addon

Build Status

usage

Topological Sort using Depth First Search(DFS)

npm install cxx-graph

var graph = require('cxx-graph');

//           0
//         /
//        1
//       / \
//      2   4 
//     / \   \
//    3   \   7
//   / \ /    |
//  8   5     |
//   \   \    |
//    \   6   |
//     \  |  /
//      \ | /  
//       9
      
var e = [
    [0,1],
    [1,2],
    [1,4],
    [2,3],
    [2,5],
    [3,5],
    [3,8],
    [4,7],
    [5,6],
    [6,9],
    [7,9],
    [8,9]
  ];
var inst = new graph.Graph(10, e);
console.log(inst.topoSort()) // [0, 1, 4, 7, 2, 3, 8, 5, 6, 9]

TODO

  • Topological Sort using Breadth First Search(BFS)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published