forked from davidcoallier/node-graph
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Coallier
committed
Nov 6, 2010
1 parent
0c4c55d
commit 9b18187
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var sys = require('sys'); | ||
var edge = require('../lib/edge'); | ||
var graph = require('../lib/graph'); | ||
var vertex = require('../lib/vertex'); | ||
|
||
var Graph = new graph.Graph(); | ||
var VertexOne = new vertex.Vertex('nameOne', {}); | ||
var VertexTwo = new vertex.Vertex('nameTwo', {}); | ||
var VertexThree = new vertex.Vertex('nameThree', {}); | ||
|
||
Graph.addVertex(VertexOne); | ||
Graph.addVertex(VertexTwo); | ||
Graph.addVertex(VertexThree); | ||
|
||
Graph.addEdge(new edge.Edge('nameOne', 'nameTwo', {})); | ||
Graph.addEdge(new edge.Edge('nameOne', 'nameThree', {})); | ||
|
||
var verts = Graph.getVertices(); | ||
sys.puts(sys.inspect(VertexTwo.isNeighbourOf('nameOnex'))); |