Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josugoar/scinet
Network science abstract data types
https://github.com/josugoar/scinet
algorithms data-structures
Last synced: 25 days ago
JSON representation
Network science abstract data types
- Host: GitHub
- URL: https://github.com/josugoar/scinet
- Owner: josugoar
- License: mit
- Created: 2020-05-25T11:21:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-12-15T20:18:58.000Z (about 1 month ago)
- Last Synced: 2024-12-15T21:22:51.844Z (about 1 month ago)
- Topics: algorithms, data-structures
- Language: Python
- Homepage: https://pypi.org/project/scinet-josugoar
- Size: 149 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scinet
> Network science abstract data types
**scinet.Graph** is designed upon the [graph (abstract data type)](https://en.wikipedia.org/wiki/Graph_(abstract_data_type)) definition and functions as a bare bones skeletal graph data mapping, containing abstract vertices and edges.
Includes DiGraph and MultiGraph support, with HyperGraph capabilities.
## Installation
1. Install [Python >= 3.8](https://www.python.org/downloads/)
2. Install [scinet]()
```sh
$ pip install scinet-josugoar
```## Usage
Import **scinet**
```py
import scinet as sn
```Create graph
```py
G = sn.Graph()
```Manipulate data
* add_vertex
```py
G.add_vertex(vertex := "foo")
```* add_edge
Edges must be assigned using hashable keys so that no name conflicts exist between source_vertex and target_vertex edges
```py
key = G.add_edge(source_vertex := "foo", target_vertex := "bar"[, edge := "foobar"])
```* remove_vertex
```py
G.remove_vertex(vertex := "foo")
```* remove_edge
```py
G.remove_edge(source_vertex := "foo", target_vertex := "bar"[, edge := "foobar"])")
```* adjacent
```py
(target_vertex := "bar") in G[(source_vertex := "foo")]
>>> True
```* neighbours
```py
set(G[(vertex := "foo")])
>>> { "neighbour_1", "neighbour_2", ... }
```See [docs](docs/scinet.html) for further details.