Giter VIP home page Giter VIP logo

graffiti's Introduction

graffiti

Graffiti is generic graph library written in Go.

Prerequisites

  • An installation of Go 1.18 or later (graffiti uses generics)

Features

Data structures

The Graph interface provides an abstract capability description of a graph:

type Graph[N any, E IHalfEdge] interface {
    NodeCount() int
    EdgeCount() int
    GetNode(id NodeId) N
    GetHalfEdgesFrom(id NodeId) []E
}

There are currently two implementations of the Graph interface:

  • Adjacency List
  • Adjacency Array

Shortest path algorithms

Shortest path algorithms aim at finding the shortest path between a source and a target node in a weighted graph. Graffiti implements Dijkstra's algorithm, which serves as a baseline. Beside that, the following speed-up techniques as well as the required preprocessing steps or heuristics (if applicable) are implemented:

  • Bidirectional Dijkstra's algorithm
  • A* search algorithm
    • Haversine Heuristic
    • ALT (A*, landmarks and triangular inequalities)
  • Bidirectional A* search algorithm
  • Dijkstra's algorithm with arc flags
  • Bidirectional Dijkstra's algorithm with arc flags
  • Dijkstra's algorithm with two-level arc flags
  • Combination of A* search algorithm with arcflags
    • unidirectional A* search to avoid cumbersome stopping criterion
    • incorporates bidirectional arcflags

Demo

The osm-ship-routing repository features a REST-API for global ship navigation. The underlying graph is represented by graffiti's AdjacencyArrayGraph data structure and the graph search calls graffiti's BidirectionalArcFlagRouter.

License

Graffiti is licensed under the MIT License.

SPDX-License-Identifier: MIT

graffiti's People

Contributors

dmholtz avatar

Stargazers

 avatar  avatar

Watchers

 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.