graphx 1.0.0

A basic graph library for Haxe

Released 2016-05-07.

To install, run:

haxelib install graphx 1.0.0

See using Haxelib in Haxelib documentation for more information.

Maintainerandywhite37
Websitehttps://github.com/andywhite37/graphx
Current version1.0.0
StatisticsInstalled 180 times
LicenseMIT
Tags graph, utility

README.md

graphx

Basic object graph utilities for Haxe

Features

  • Graph creation for nodes of the same type
  • Depth-first search
  • Breadth-first search (TODO)
  • Cycle detection (TODO)
  • Topological sort

Examples

var graph : Graph<String> = new Graph({
  equals: function(a, b) return a == b,
  getKey: function(a) return a
});
graph.addEdgesFrom("eat breakfast", ["take out trash"]);
graph.addEdgesFrom("brush teeth", ["shave"]);
graph.addEdgesFrom("get dressed", ["eat breakfast", "read paper"]);
graph.addEdgesFrom("shave", ["get dressed"]);
graph.addEdgesFrom("wake up", ["brush teeth", "take shower"]);
graph.addEdgesFrom("take out trash", ["go to work"]);

var results = graph.topologicalSort();
trace(results);
// ["wake up", "take shower", "brush teeth", "shave", "get dressed",
//  "read paper", "eat breakfast", "take out trash", "go to work"]

API

TODO