Skip to main content

Create and use graphs theory for maths

Project description

Gratheory - A mathematical graphing module for python

Create a graph -

from gratheory import Graph

g = graph(l, oneWayEdges = k)

where l is a list of edges in the format of [A, B, C] is an edge from A to B with weighting of C and oneWayEdges is a boolean of whether edges go in both directions or not.

To find the shortest path, use g.findShortestPath(start, end, searchType = A) where start is the start vertex, end is the end vertex and searchType is either 'Ford' or 'Djikstra' deciding which algorithm to implement, the default being 'Ford'.

Depth first search and Breadth first search will return a list of reachable vertices from a given vertex. Callable with method, DFS and BFS.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Gratheory-0.1.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

Gratheory-0.1.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page