All Projects → pangloss → fermor

pangloss / fermor

Licence: MIT License
Fast, powerful, general-purpose graph traversal and modelling tools plus a performant immutable in-memory graph database.

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to fermor

js-data-structures
🌿 Data structures for JavaScript
Stars: ✭ 56 (+154.55%)
Mutual labels:  immutable, graphs
vf3lib
VF3 Algorithm - The fastest algorithm to solve subgraph isomorphism on large and dense graphs
Stars: ✭ 58 (+163.64%)
Mutual labels:  graphs
angular-fusioncharts
Angular Component for FusionCharts JavaScript Charting Library
Stars: ✭ 53 (+140.91%)
Mutual labels:  graphs
php-json-schema-model-generator
Creates (immutable) PHP model classes from JSON-Schema files including all validation rules as PHP code
Stars: ✭ 36 (+63.64%)
Mutual labels:  immutable
wxapp-boilerplate
微信小程序开发脚手架 (ES6, Redux, Immutable-js, Async/await, Promise, Reselect, Babel, ESLint, Stylelint, Gulp ... )
Stars: ✭ 35 (+59.09%)
Mutual labels:  immutable
icingaweb2-module-pnp
Integrate PNP graphs into Icinga Web 2
Stars: ✭ 32 (+45.45%)
Mutual labels:  graphs
json-immutable
Immutable.JS structure-aware JSON serializer/deserializer
Stars: ✭ 23 (+4.55%)
Mutual labels:  immutable
silky-charts
A silky smooth D3/React library
Stars: ✭ 38 (+72.73%)
Mutual labels:  graphs
fastener
Functional Zipper for manipulating JSON
Stars: ✭ 54 (+145.45%)
Mutual labels:  immutable
DRL graph exploration
Autonomous Exploration Under Uncertainty via Deep Reinforcement Learning on Graphs
Stars: ✭ 53 (+140.91%)
Mutual labels:  graphs
CryptoGraphArb
Using graph algorithms to find arbitrage opportunities
Stars: ✭ 89 (+304.55%)
Mutual labels:  graphs
pbPlots
A plotting library available in many programming languages.
Stars: ✭ 71 (+222.73%)
Mutual labels:  graphs
3013-Algorithms
Algorithms Course Repo
Stars: ✭ 15 (-31.82%)
Mutual labels:  graphs
py-problems-solutions
Implementations of various problems using Python. Dynamic Programming, BackTracking & Sorting algorithms 💻
Stars: ✭ 20 (-9.09%)
Mutual labels:  graphs
dlaudio
Master thesis: Structured Auto-Encoder with application to Music Genre Recognition (code)
Stars: ✭ 14 (-36.36%)
Mutual labels:  graphs
treecko
A collection of functional and immutable helpers for working with tree data structures.
Stars: ✭ 31 (+40.91%)
Mutual labels:  immutable
VieCut
VieCut 1.00 - Shared-memory Minimum Cuts
Stars: ✭ 34 (+54.55%)
Mutual labels:  graphs
persian-date-time
Persian Date Time
Stars: ✭ 54 (+145.45%)
Mutual labels:  immutable
WordMat
WordMat is an add-in to MicroSoft Word enabling math functionality
Stars: ✭ 25 (+13.64%)
Mutual labels:  graphs
myConsole
基于 TS + React + Mobx 实现的移动端浏览器控制台开发教程
Stars: ✭ 26 (+18.18%)
Mutual labels:  immutable

Fermor provides a flexible and high performance streaming data traversal library built upon Clojure's lazy seq abstraction. It's designed to allow exploration of complex graphs of data, elegantly handling cycles, deep nesting and other patterns commonly seen in graph data.

This library is a distillation of my experience creating and working with my Pacer library, which I have used to build diverse sophisticated applications. Compared to Pacer, Fermor is much lighter weight, more flexible, simpler and far faster, despite Pacer (as of a few years ago) itself generally being much faster than other graph traversal mechanisms that I had seen.

Alpha software and roadmap

This project has mostly stabilised. The next major steps are to performance tune and possibly integrate the Neo4j embedded API which may require some minor protocol adjustments, but I don't anticipate major changes.

High performance in-memory immutable graph database

Bundled with the traversal library is a fast immutable in-memory directed property graph database built on the very elegant Bifurcan library. I use it to build up graphs of 1-10 million vertices and edges in under 10 seconds, with all queries I've needed to do so far running in 10-20ms, and full edge counts in 1-2s, all on my laptop.

The Fermor traversal namespace works well with any data source and there is no dependency between most of the functions in the library and the included graph.

Powerful, composable and expressive traversal library

Like the Clojure core library, the functions in Fermor's traversal library are composable.

The key to using this library effectively is to treat it as a set of primitive building blocks for creating your own domain-specific library.

In my examples below I will try to follow the pattern of decomposing functions into small atomic units. This decomposition leads to surprising flexibility without any performance overhead at all.

Introduction

To traverse from one sequence of vertices to a related sequence of vertices means following an edge in the graph. You can do that using the in and out functions: out follows edges that originate in each element (the "out edges") of the sequence and returns the vertex that the edge arrives at. You could think of it as following edges in their forward direction. Sometimes we want to go the other way, and we can do that with in, which follows edges that point to the vertices in the sequence and returns the vertices that those edges originate from.

It's good practice to include both element types in an edge name as I do here.

The following example is admittedly terrible. Until I get a better example set up, please see the gremlin examples and cypher examples, where I've taken the most sophisticated examples I've been able to find in those projects' documentation and translated them to use fermor. More interesting examples are very welcome so please do send them my way if you know of good ones.

(defn cities [states]
  (->> states
       (out :state->city)))

(defn states [cities]
  (->> cities
       (in :state->city)))

(defn large-city? [city]
  (< 1000000 (population city)))

In Clojure, we filter data all the time. We don't need to change that:

(defn large-cities [states]
  (->> states
       cities
       (filter large-city?)))

Lookaheads come in a few varieties. They are filters that match based on whether there is or isn't the expected data connected to the element at hand.

(defn states-with-a-large-city [states]
  (->> states
       (lookahead large-cities)))

We can also do lookaheads with specific min and max arguments.

(defn states-with-2to5-large-cities [states]
  (->> states
       (lookahead {:min 2 :max 5} large-cities)))

Or do a negative lookahead to say what we don't want (like the core remove function).

(defn states-without-a-large-city [states]
  (->> states
       (neg-lookahead large-cities)))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].