All Projects → phgraph → graph

phgraph / graph

Licence: MIT license
modern mathematical graph/network library written in PHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to graph

j2
j2 is a minimalist concatenative programming language that makes up for its simplicity by its ability to natively bind with C libraries' ABI *and types*, *without glue*
Stars: ✭ 37 (+208.33%)
Mutual labels:  graphviz, graph-algorithms
Advanced-Shortest-Paths-Algorithms
Java Code for Contraction Hierarchies Algorithm, A-Star Algorithm and Bidirectional Dijkstra Algorithm. Tested and Verified Code.
Stars: ✭ 63 (+425%)
Mutual labels:  graph-algorithms, shortest-path-algorithm
cytoscape.js-fcose
fCoSE: a fast Compound Spring Embedder
Stars: ✭ 94 (+683.33%)
Mutual labels:  graphviz, graph-algorithms
sqlw-mysql
Wrapper code (or any text source) generator for MySQL databases and queries
Stars: ✭ 45 (+275%)
Mutual labels:  graphviz
position-rank
PositionRank: An Unsupervised Approach to Keyphrase Extraction from Scholarly Documents
Stars: ✭ 89 (+641.67%)
Mutual labels:  graph-algorithms
shortest-path
Javascript solution code + test suite for the Shortest Path Problem, using Dijkstra's Algorithm.
Stars: ✭ 27 (+125%)
Mutual labels:  shortest-path-algorithm
chinese-postman-problem
C++ solution for the chinese postman problem
Stars: ✭ 19 (+58.33%)
Mutual labels:  graph-algorithms
graphstore
Fast in-memory graph structure, powering Gephi
Stars: ✭ 64 (+433.33%)
Mutual labels:  graphviz
lynxkite
The complete graph data science platform
Stars: ✭ 120 (+900%)
Mutual labels:  graph-algorithms
LaplacianOpt.jl
A Julia/JuMP Package for Maximizing Algebraic Connectivity of Undirected Weighted Graphs
Stars: ✭ 16 (+33.33%)
Mutual labels:  graph-algorithms
mage
MAGE - Memgraph Advanced Graph Extensions 🔮
Stars: ✭ 89 (+641.67%)
Mutual labels:  graph-algorithms
visualsc
A simplicial complex and hypergraph visualization tool similar to Graphviz.
Stars: ✭ 31 (+158.33%)
Mutual labels:  graphviz
hugegraph-computer
A large-scale graph computing system, basic on disk/memory & integrate with graph database HugeGraph
Stars: ✭ 18 (+50%)
Mutual labels:  graph-algorithms
Graph-Algorithms
Everything you need to know about graph theory to ace a technical interview 🔥
Stars: ✭ 87 (+625%)
Mutual labels:  graph-algorithms
kaliningraph
🕸️ Graphs, finite fields and discrete dynamical systems in Kotlin
Stars: ✭ 62 (+416.67%)
Mutual labels:  graph-algorithms
gcnn keras
Graph convolution with tf.keras
Stars: ✭ 47 (+291.67%)
Mutual labels:  graph-algorithms
ipydagred3
ipywidgets library for drawing directed acyclic graphs in jupyterlab using dagre-d3
Stars: ✭ 38 (+216.67%)
Mutual labels:  graphviz
PyBC
Bitcoin blockchain parser for Python 2 and 3. Includes handy examples.
Stars: ✭ 26 (+116.67%)
Mutual labels:  graph-algorithms
GraphLIME
This is a Pytorch implementation of GraphLIME
Stars: ✭ 40 (+233.33%)
Mutual labels:  graph-algorithms
Traverser
Traverser is a Java library that helps software engineers implement advanced iteration of a data structure.
Stars: ✭ 45 (+275%)
Mutual labels:  graph-algorithms

Build Status Coverage Status StyleCI Maintainability

phgraph/graph

PHGraph is a modern mathematical graph/network library written in PHP.

Installation

You can install the package via composer:

composer require phgraph/graph

Usage

Creation and Search

use PHGraph\Graph;
use PHGraph\Search\BreadthFirst;
…

$graph = new Graph;
$columbus = $graph->newVertex([
    'name' => 'Columbus',
]);
$cleveland = $graph->newVertex([
    'name' => 'Cleveland',
]);
$cincinnati = $graph->newVertex([
    'name' => 'Cincinnati',
]);

$columbus->createEdge($cleveland);
$columbus->createEdge($cincinnati);

$search = new BreadthFirst($cincinnati);
if ($search->hasVertex($cleveland)) {
    echo "We can get from Cincinnati to Cleveland\n";
} else {
    echo "We can’t get from Cincinnati to Cleveland\n";
}

Graph drawing

This library has support for visualizing graphs as images using GraphViz "Graph Visualization Software". You will need GraphViz installed on your system for this to work.

use PHGraph\Graph;
use PHGraph\GraphViz\GraphViz;
…

$graph = new Graph;
$columbus = $graph->newVertex([
    'name' => 'Columbus',
]);
$cleveland = $graph->newVertex([
    'name' => 'Cleveland',
]);
$cincinnati = $graph->newVertex([
    'name' => 'Cincinnati',
]);
$columbus->createEdge($cleveland);
$columbus->createEdge($cincinnati);

$graphviz = new GraphViz($graph);
// open the image on your system
$graphviz->display();

output:

display output

Algorithms

A graph library is rather boring without the ability to use algorithms on it, here is a list of the currently supported ones:

Development

Installing dependencies

You will need Composer for the development dependencies. Once you have that, run the following

$ composer install

Running tests

You can run the current test suite with the following command

$ composer test

For static analysis of the code run the following

$ composer analyse

Bug Reports

Bug reports for the current release version can be opened in this repository’s issue tracker.

Thanks

this was heavily inspired by graphp/graph.

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].