GithubHelp home page GithubHelp logo

global19-atlassian-net / pygraph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jciskey/pygraph

0.0 2.0 0.0 140 KB

A graph manipulation library in pure Python

License: MIT License

Python 100.00%

pygraph's Introduction

pygraph

A graph manipulation library in pure Python

Available on PyPI

Pygraph aims to be an easy-to-use and functional graph library that doesn't sacrifice advanced capabilities or usability in the process.

By implementing the library in pure Python, it can be installed without any dependencies aside from the Python core, enabling maximum ease of use.

Graph Types Supported:

  • Directed Graphs
  • Undirected Graphs

Common Algorithms Supported:

  • DFS
  • BFS
  • Minimum Spanning Tree
  • Connected Components
  • Biconnected Components
  • Articulation Vertices

Advanced algorithms supported will include:

  • Triconnected Components
  • Separation Pairs
  • Lipton-Tarjan Separator Theorem
  • Planarity Testing
  • Fully Dynamic Planarity Testing
  • Planar Embedding

Current Algorithm Support

Algorithm Status
DFS ✅ Supported
BFS ✅ Supported
MST ✅ Supported
Connected Components ✅ Supported
Biconnected Components ✅ Supported
Triconnected Components ❌ Unsupported
Articulation Vertices ✅ Supported
Separation Pairs ❌ Unsupported
L-T Separator Theorem ❌ Unsupported
Planarity Testing ✅ Supported
Planar Embedding ❌ Unsupported
Fully-Dynamic Planarity Testing ❌ Unsupported

Installation && Usage

Installing the module is as easy as pip install pygraph

>>> import pygraph
>>> g = pygraph.build_chvatal_graph()
>>> pygraph.is_planar(g)
False

Running the Test Suite

The entire test suite is written using the standard library unittest module, so you should be able to run it with whichever framework you most prefer. We recommend nose.

With nose installed, navigate to the root of the project and run nosetests. It should recognize the tests subdirectory and run through the entire test suite.

All algorithm implementations should have test cases written and passing.

Contributions

Contributions are more than welcome! Algorithm suggestions, implementations, or even additional tests for existing algorithms are all great ways to contribute. Not a coder? That's fine too! This project is in dire need of documentation and examples.

Planarity Test Cases

The planarity testing algorithm is extremely complicated. As such, more tests with more graphs are desired. Good sources of known graphs are:

For non-planar graphs, priority should be given to ones that don't fall afoul of Euler's Formula, so that the actual planarity testing algorithm is tested.

pygraph's People

Contributors

jciskey avatar adelplanque avatar fynardo avatar

Watchers

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