depth-first-search:用于在图形上执行 DFS 并返回可用路径的节点模块

时间:2024-07-13 14:55:12
【文件属性】:

文件名称:depth-first-search:用于在图形上执行 DFS 并返回可用路径的节点模块

文件大小:8KB

文件格式:ZIP

更新时间:2024-07-13 14:55:12

JavaScript

深度优先搜索 用于在图形上执行 DFS 并返回可用路径的节点模块 用法 var DFS = require ( 'dfs' ) ; //create new DFS graph var dfs = new DFS ( ) ; // or optionally pass map of edges var dfs = new DFS ( [ 'A' , 'B' ] ) ; //TODO //add edges to the graph dfs . addEdge ( from , to ) ; //return all paths (as CSV) available between two nodes. dfs . search ( from , to ) ; ## Further details Check out the tests for more examples .


【文件预览】:
depth-first-search-master
----.gitignore(493B)
----package.json(835B)
----gulpfile.js(353B)
----LICENSE(11KB)
----README.md(445B)
----tests()
--------dfs.spec.js(3KB)
----lib()
--------index.js(1KB)

网友评论