A fast python graph library based on numpy and scipy.
Project description
Another Python Graph Library is a simple, fast and easy to use graph library. Here is an example of its usage:
::
>>> from apgl.graph import GeneralVertexList, SparseGraph
>>> numVertices = 5
>>> graph = SparseGraph(numVertices)
>>> graph[0,1] = 1
>>> graph[0,2] = 3
>>> graph[1,2] = 0.1
>>> graph[3,4] = 2
>>> graph.setVertex(0, "abc")
>>> graph.findConnectedComponents()
[[0, 1, 2], [3, 4]]
>>> graph.getWeightMatrix()
array([[ 0. , 1. , 3. , 0. , 0. ],
[ 1. , 0. , 0.1, 0. , 0. ],
[ 3. , 0.1, 0. , 0. , 0. ],
[ 0. , 0. , 0. , 0. , 2. ],
[ 0. , 0. , 0. , 2. , 0. ]])
>>> graph.degreeDistribution()
array([0, 2, 3])
>>> graph.neighbours(0)
array([2, 1], dtype=int32)
>>> print(graph)
SparseGraph: vertices 5, edges 4, undirected, vertex list type: GeneralVertexList
More Information
----------------
* See the user guide at http://pythonhosted.org/apgl/
* The source code is available at https://github.com/charanpald/APGL
::
>>> from apgl.graph import GeneralVertexList, SparseGraph
>>> numVertices = 5
>>> graph = SparseGraph(numVertices)
>>> graph[0,1] = 1
>>> graph[0,2] = 3
>>> graph[1,2] = 0.1
>>> graph[3,4] = 2
>>> graph.setVertex(0, "abc")
>>> graph.findConnectedComponents()
[[0, 1, 2], [3, 4]]
>>> graph.getWeightMatrix()
array([[ 0. , 1. , 3. , 0. , 0. ],
[ 1. , 0. , 0.1, 0. , 0. ],
[ 3. , 0.1, 0. , 0. , 0. ],
[ 0. , 0. , 0. , 0. , 2. ],
[ 0. , 0. , 0. , 2. , 0. ]])
>>> graph.degreeDistribution()
array([0, 2, 3])
>>> graph.neighbours(0)
array([2, 1], dtype=int32)
>>> print(graph)
SparseGraph: vertices 5, edges 4, undirected, vertex list type: GeneralVertexList
More Information
----------------
* See the user guide at http://pythonhosted.org/apgl/
* The source code is available at https://github.com/charanpald/APGL
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
apgl-0.8.1.tar.gz
(89.5 kB
view details)
Built Distributions
apgl-0.8.1-py3.4.egg
(329.9 kB
view details)
apgl-0.8.1-py3.2.egg
(326.2 kB
view details)
apgl-0.8.1-py2.7.egg
(321.1 kB
view details)
File details
Details for the file apgl-0.8.1.tar.gz
.
File metadata
- Download URL: apgl-0.8.1.tar.gz
- Upload date:
- Size: 89.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d52c632aab7028cdbb64ce3f47953aaa3de3bbf5ab6647c9643e91d8166a7f6e |
|
MD5 | 9cc189a76d3a5558189ae9b38573ed4b |
|
BLAKE2b-256 | fb2a7f2262317faed16a0551b550874b73e107cffa3d9ee69b0451d21ee380b5 |
File details
Details for the file apgl-0.8.1-py3.4.egg
.
File metadata
- Download URL: apgl-0.8.1-py3.4.egg
- Upload date:
- Size: 329.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c319302b592859e7ffbd716dfe57bdf75e8ed55124464c8d4613e6fd49702f78 |
|
MD5 | 6a8c77d5e9b6316d0e1c5d92bf1bfb0f |
|
BLAKE2b-256 | dca01e57036e50fcca0e16b166377eb5e775aa706dc1c56a269f9a60e17c9a86 |
File details
Details for the file apgl-0.8.1-py3.2.egg
.
File metadata
- Download URL: apgl-0.8.1-py3.2.egg
- Upload date:
- Size: 326.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 197e3d4c43e76e285298c47c35d7e2450c10d07c5640a3f0a19dff15f45eab78 |
|
MD5 | 3c69ef77185a20f10a7976847ec3e7e9 |
|
BLAKE2b-256 | 4477b4fed52b4fcbe8aa1c3fb9284ab60366ef11d05df7062960cc1dbea35033 |
File details
Details for the file apgl-0.8.1-py2.7.egg
.
File metadata
- Download URL: apgl-0.8.1-py2.7.egg
- Upload date:
- Size: 321.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | edaf1dc4d52be5c8488cc238453fe91509bebe86a96eab1c46160624bf65dced |
|
MD5 | 2c074f4dd79b795440ea9d950c50346a |
|
BLAKE2b-256 | 003e6f9d4b13d6d76ec2b48995df151f37886f69810ae603839385bb6bebf568 |