Git Product home page Git Product logo

node-graph's Introduction

node.js Graph Theory module

Maths is fun and so is node.js so why not use them together!

introduction

The goal of this "node-graph" module is to provide a framework for working with graphs from within node.js.

It allow (will) developers to build different types of graphs G, create vertices associated to that graph V(G), and create edges to associate/link the vertices together E(G).

After building the graphs, it will allow developers to traverse, sort and play with the graphs using the most popular algorithms.

Currently in EXTREMELY early stages, feel free to contribute!

synopsis

Creating a basic Graph object:

var sys   = require('sys');
var graph = require('./lib/graph');

var Graph = new graph.Graph();

Now that you have your Graph object, you should add vertices. In order to do that, do:

var vertex = require('./lib/vertex');
var vertexOne = new vertex.Vertex('label1', {});
Graph.addVertex(vertexOne);

To make that graph more interesting, you'll need to add a second vertex. This time, you can do it inline like such:

Graph.addVertex(new vertex.Vertex('label2', {}));

Once you are done, you can now create an edge to link those two vertices together:

Graph.addEdge(new Edge('label1', 'label2', {}));

Now the next step is to build more stuff on top of that :-)

license

Released under the New BSD License.

Copyright (c) 2010 David Coallier

disclaimer

Very likely to be broken. Feel free to contribute, there's still a lot to do, this is merely teh beginning of the whole graph engine.

node-graph's People

Contributors

nathanoehlman avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.