graphx

A basic graph library for Haxe
https://github.com/andywhite37/graphx

To install, run:

haxelib install graphx 1.0.0 

See using Haxelib in Haxelib documentation for more information.

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

Contributors
andywhite37
Version
1.0.0
Published
2 years ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github