Giter VIP home page Giter VIP logo

aboditgraph's Introduction

AboditGraph

Graph library for RDF-like in-memory graphs. Efficient either-direction traversals. Provides depth-first, breadth-first and random-first traversals, topological sort, path finding, and page rank algorithms. Supports Dotgraph for rendering output which is very helpful when debugging.

image

Create a graph using RDF-like predicates on nodes of any type.

    var g = new Graph<string, Relation>();
    g.AddStatement("a", Relation.RDFSType, "b");
    g.AddStatement("a", Relation.RDFSType, "c");
    g.AddStatement("b", Relation.RDFSType, "d");
    g.AddStatement("c", Relation.RDFSType, "e");
    g.AddStatement("d", Relation.RDFSType, "f");
    g.AddStatement("e", Relation.RDFSType, "f");

And then traverse it, union it, intersect it, find paths, topological sorts, page rank, ...

    var sorted = string.Join("", g.TopologicalSortApprox());
    sorted.Should().Be("abcdef");

    var path = g.ShortestPath(a, Relation.RDFSType, e, (r) => 1.0, (x, y) => x + y);
    string result = string.Join(";", path);
    result.Should().Be("a;c;e");

Why create another graph library?

  1. Performance when traversing a graph in both directions.
  2. Full control over Node and Edge type including the ability to use Nodes as Edges in true RDF 'turtles-all-the-way-down' fashion.
  3. Compact in memory representation for very large in-memory graphs.
  4. Immutable data structures wherever possible.
  5. Complete set of algorithms including exploration, path finding, union, topological sort and page rank.
  6. Support for Dotgraph rendering of graphs.

Nuget

Available on nuget as https://www.nuget.org/packages/Abodit.Graph

aboditgraph's People

Contributors

ianmercer avatar

Stargazers

Yves Reynhout avatar Cédric Luthi avatar Damian Hickey avatar Matthew Severson avatar  avatar smartcaveman avatar Amna Al Naseri avatar Paperinik avatar Ben Jones avatar

Watchers

 avatar James Cloos avatar  avatar  avatar Amna Al Naseri 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.