# ntwrk
[![PyPI version](https://badge.fury.io/py/ntwrk.svg)](https://badge.fury.io/py/ntwrk)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
This library was created to simplify the concept of graphs by visualizing them in a perfect and clear way, especially for beginners in data structures.
## Installation
You can install `ntwrk` via pip:
```bash
pip install ntwrk
```
## Usage
### For undirected unweighted graph
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges)
print(g)
```
#### Output
```bash
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}
Edges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}
```
#### You can show all details (adjacency matrix, adjacency list)
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges, detail=True)
print(g)
```
#### Output
```bash
Adjacency matrix :
----------------
╒═════════╤═════╤═════╤═════╤═════╤═════╤═════╤═════╕
│ Nodes │ n │ e │ t │ w │ o │ r │ k │
╞═════════╪═════╪═════╪═════╪═════╪═════╪═════╪═════╡
│ n │ 0 │ 1 │ 1 │ 1 │ 1 │ 0 │ 1 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ e │ 1 │ 0 │ 1 │ 0 │ 1 │ 1 │ 0 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ t │ 1 │ 1 │ 0 │ 1 │ 0 │ 0 │ 1 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ w │ 1 │ 0 │ 1 │ 0 │ 1 │ 1 │ 0 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ o │ 1 │ 1 │ 0 │ 1 │ 0 │ 1 │ 1 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ r │ 0 │ 1 │ 0 │ 1 │ 1 │ 0 │ 1 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ k │ 1 │ 0 │ 1 │ 0 │ 1 │ 1 │ 0 │
╘═════════╧═════╧═════╧═════╧═════╧═════╧═════╧═════╛
Adjacency list :
--------------
╒═════════╤══════════════════╕
│ Nodes │ Adjacent Nodes │
╞═════════╪══════════════════╡
│ n │ ╒═══╕ │
│ │ │ e │ │
│ │ ├───┤ │
│ │ │ t │ │
│ │ ├───┤ │
│ │ │ w │ │
│ │ ├───┤ │
│ │ │ o │ │
│ │ ├───┤ │
│ │ │ k │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ e │ ╒═══╕ │
│ │ │ n │ │
│ │ ├───┤ │
│ │ │ t │ │
│ │ ├───┤ │
│ │ │ o │ │
│ │ ├───┤ │
│ │ │ r │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ t │ ╒═══╕ │
│ │ │ n │ │
│ │ ├───┤ │
│ │ │ e │ │
│ │ ├───┤ │
│ │ │ w │ │
│ │ ├───┤ │
│ │ │ k │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ w │ ╒═══╕ │
│ │ │ n │ │
│ │ ├───┤ │
│ │ │ t │ │
│ │ ├───┤ │
│ │ │ o │ │
│ │ ├───┤ │
│ │ │ r │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ o │ ╒═══╕ │
│ │ │ n │ │
│ │ ├───┤ │
│ │ │ e │ │
│ │ ├───┤ │
│ │ │ w │ │
│ │ ├───┤ │
│ │ │ r │ │
│ │ ├───┤ │
│ │ │ k │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ r │ ╒═══╕ │
│ │ │ e │ │
│ │ ├───┤ │
│ │ │ w │ │
│ │ ├───┤ │
│ │ │ o │ │
│ │ ├───┤ │
│ │ │ k │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ k │ ╒═══╕ │
│ │ │ n │ │
│ │ ├───┤ │
│ │ │ t │ │
│ │ ├───┤ │
│ │ │ o │ │
│ │ ├───┤ │
│ │ │ r │ │
│ │ ╘═══╛ │
╘═════════╧══════════════════╛
```
#### You can add nodes with edges
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges)
print(g)
g.add("x", edge="kx")
print(g)
```
#### Output
```bash
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}
Edges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k', 'x'}
Edges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk', 'kx'}
```
#### You can add nodes and edges
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges)
print(g)
g.add("x")
g.add_edge(node1="k", node2="x")
print(g)
```
#### Output
```bash
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}
Edges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k', 'x'}
Edges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk', 'kx'}
```
#### You can delete nodes
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k", "x"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk", "kx"]
g = graph(vertices, edges)
print(g)
g.delete_node("x")
print(g)
```
#### Output
```bash
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k', 'x'}
Edges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk', 'kx'}
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}
Edges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}
```
#### You can delete edges
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k", "x"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk", "kx"]
g = graph(vertices, edges)
print(g)
g.delete_edge("k", "x")
print(g)
```
#### Output
```bash
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k', 'x'}
Edges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk', 'kx'}
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k', 'x'}
Edges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}
```
#### You can show how many nodes are in the graph
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges)
print(len(g))
```
#### Output
```bash
7
```
#### You can show how many edges are in the graph
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges)
print(g.edge_count())
```
#### Output
```bash
15
```
#### You can show how many degrees are in the graph
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges)
print(g.degree_count())
```
#### Output
```bash
30
```
#### You can show the node degree
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges)
print(g.get_degree("n"))
```
#### Output
```bash
5
```
#### You can traverse the graph using different algorithms (DFS, BFS)
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges)
print(g.traverse("n"))
print(g.traverse("n", algorithm="dfs"))
print(g.traverse("n", algorithm="bfs"))
```
#### Output
```bash
['n', 'e', 't', 'w', 'o', 'r', 'k']
['n', 'k', 'r', 'o', 'w', 't', 'e']
['n', 'e', 't', 'w', 'o', 'k', 'r']
```
#### You can find the path between two nodes
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges)
print(g.find_path("n", "k"))
```
#### Output
```bash
['n', 'e', 't', 'w', 'o', 'r', 'k']
```
#### You can check whether the graph is connected or disconnected
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges)
print(g.isConnected())
print(g.isDisconnected())
```
#### Output
```bash
True
False
```
#### You can create a complete graph
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
g = graph(vertices, complete=True)
print(g)
```
#### Output
```bash
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}
Edges : {'ne', 'nt', 'nw', 'no', 'nr', 'nk', 'et', 'ew', 'eo', 'er', 'ek', 'tw', 'to', 'tr', 'tk', 'wo', 'wr', 'wk', 'or', 'ok', 'rk'}
```
### For undirected weighted graph
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = [("ne", 9), ("nt", 6), ("nw", 9), ("no", 1), ("nk", 3), ("et", 15), ("eo", 10), ("er", 13), ("tw", 3), ("tk", 9), ("wo", 8), ("wr", 5), ("or", 3), ("ok", 4), ("rk", 7)]
g = graph(vertices, edges, weighted=True)
print(g)
```
#### Output
```bash
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}
Edges : {['ne', 9], ['nt', 6], ['nw', 9], ['no', 1], ['nk', 3], ['et', 15], ['eo', 10], ['er', 13], ['tw', 3], ['tk', 9], ['wo', 8], ['wr', 5], ['or', 3], ['ok', 4], ['rk', 7]}
```
#### You can show all details (adjacency matrix, adjacency list)
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = [("ne", 9), ("nt", 6), ("nw", 9), ("no", 1), ("nk", 3), ("et", 15), ("eo", 10), ("er", 13), ("tw", 3), ("tk", 9), ("wo", 8), ("wr", 5), ("or", 3), ("ok", 4), ("rk", 7)]
g = graph(vertices, edges, weighted=True, detail=True)
print(g)
```
#### Output
```bash
Adjacency matrix :
----------------
╒═════════╤═════╤═════╤═════╤═════╤═════╤═════╤═════╕
│ Nodes │ n │ e │ t │ w │ o │ r │ k │
╞═════════╪═════╪═════╪═════╪═════╪═════╪═════╪═════╡
│ n │ 0 │ 9 │ 6 │ 9 │ 1 │ 0 │ 3 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ e │ 9 │ 0 │ 15 │ 0 │ 10 │ 13 │ 0 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ t │ 6 │ 15 │ 0 │ 3 │ 0 │ 0 │ 9 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ w │ 9 │ 0 │ 3 │ 0 │ 8 │ 5 │ 0 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ o │ 1 │ 10 │ 0 │ 8 │ 0 │ 3 │ 4 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ r │ 0 │ 13 │ 0 │ 5 │ 3 │ 0 │ 7 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ k │ 3 │ 0 │ 9 │ 0 │ 4 │ 7 │ 0 │
╘═════════╧═════╧═════╧═════╧═════╧═════╧═════╧═════╛
Adjacency list :
--------------
╒═════════╤════════════════════════════════╕
│ Nodes │ ╒════════════════╤═════════╕ │
│ │ │ Adjacent Nodes │ Weights │ │
│ │ ╘════════════════╧═════════╛ │
╞═════════╪════════════════════════════════╡
│ n │ ╒═══╤═══╕ │
│ │ │ e │ 9 │ │
│ │ ├───┼───┤ │
│ │ │ t │ 6 │ │
│ │ ├───┼───┤ │
│ │ │ w │ 9 │ │
│ │ ├───┼───┤ │
│ │ │ o │ 1 │ │
│ │ ├───┼───┤ │
│ │ │ k │ 3 │ │
│ │ ╘═══╧═══╛ │
├─────────┼────────────────────────────────┤
│ e │ ╒═══╤════╕ │
│ │ │ n │ 9 │ │
│ │ ├───┼────┤ │
│ │ │ t │ 15 │ │
│ │ ├───┼────┤ │
│ │ │ o │ 10 │ │
│ │ ├───┼────┤ │
│ │ │ r │ 13 │ │
│ │ ╘═══╧════╛ │
├─────────┼────────────────────────────────┤
│ t │ ╒═══╤════╕ │
│ │ │ n │ 6 │ │
│ │ ├───┼────┤ │
│ │ │ e │ 15 │ │
│ │ ├───┼────┤ │
│ │ │ w │ 3 │ │
│ │ ├───┼────┤ │
│ │ │ k │ 9 │ │
│ │ ╘═══╧════╛ │
├─────────┼────────────────────────────────┤
│ w │ ╒═══╤═══╕ │
│ │ │ n │ 9 │ │
│ │ ├───┼───┤ │
│ │ │ t │ 3 │ │
│ │ ├───┼───┤ │
│ │ │ o │ 8 │ │
│ │ ├───┼───┤ │
│ │ │ r │ 5 │ │
│ │ ╘═══╧═══╛ │
├─────────┼────────────────────────────────┤
│ o │ ╒═══╤════╕ │
│ │ │ n │ 1 │ │
│ │ ├───┼────┤ │
│ │ │ e │ 10 │ │
│ │ ├───┼────┤ │
│ │ │ w │ 8 │ │
│ │ ├───┼────┤ │
│ │ │ r │ 3 │ │
│ │ ├───┼────┤ │
│ │ │ k │ 4 │ │
│ │ ╘═══╧════╛ │
├─────────┼────────────────────────────────┤
│ r │ ╒═══╤════╕ │
│ │ │ e │ 13 │ │
│ │ ├───┼────┤ │
│ │ │ w │ 5 │ │
│ │ ├───┼────┤ │
│ │ │ o │ 3 │ │
│ │ ├───┼────┤ │
│ │ │ k │ 7 │ │
│ │ ╘═══╧════╛ │
├─────────┼────────────────────────────────┤
│ k │ ╒═══╤═══╕ │
│ │ │ n │ 3 │ │
│ │ ├───┼───┤ │
│ │ │ t │ 9 │ │
│ │ ├───┼───┤ │
│ │ │ o │ 4 │ │
│ │ ├───┼───┤ │
│ │ │ r │ 7 │ │
│ │ ╘═══╧═══╛ │
╘═════════╧════════════════════════════════╛
```
### For directed unweighted graph
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges, directed=True)
print(g)
```
#### Output
```bash
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}
Edges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}
```
#### You can show all details (adjacency matrix, adjacency list)
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges, directed=True, detail=True)
print(g)
```
#### Output
```bash
Adjacency matrix :
----------------
╒═════════╤═════╤═════╤═════╤═════╤═════╤═════╤═════╕
│ Nodes │ n │ e │ t │ w │ o │ r │ k │
╞═════════╪═════╪═════╪═════╪═════╪═════╪═════╪═════╡
│ n │ 0 │ 1 │ 1 │ 1 │ 1 │ 0 │ 1 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ e │ 0 │ 0 │ 1 │ 0 │ 1 │ 1 │ 0 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ t │ 0 │ 0 │ 0 │ 1 │ 0 │ 0 │ 1 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ w │ 0 │ 0 │ 0 │ 0 │ 1 │ 1 │ 0 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ o │ 0 │ 0 │ 0 │ 0 │ 0 │ 1 │ 1 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ r │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 1 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ k │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │
╘═════════╧═════╧═════╧═════╧═════╧═════╧═════╧═════╛
Adjacency list :
--------------
╒═════════╤══════════════════╕
│ Nodes │ Adjacent Nodes │
╞═════════╪══════════════════╡
│ n │ ╒═══╕ │
│ │ │ e │ │
│ │ ├───┤ │
│ │ │ t │ │
│ │ ├───┤ │
│ │ │ w │ │
│ │ ├───┤ │
│ │ │ o │ │
│ │ ├───┤ │
│ │ │ k │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ e │ ╒═══╕ │
│ │ │ t │ │
│ │ ├───┤ │
│ │ │ o │ │
│ │ ├───┤ │
│ │ │ r │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ t │ ╒═══╕ │
│ │ │ w │ │
│ │ ├───┤ │
│ │ │ k │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ w │ ╒═══╕ │
│ │ │ o │ │
│ │ ├───┤ │
│ │ │ r │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ o │ ╒═══╕ │
│ │ │ r │ │
│ │ ├───┤ │
│ │ │ k │ │
│ │ ╘═══╛ │
├─────────┼──────────────────┤
│ r │ k │
╘═════════╧══════════════════╛
```
#### You can check whether the graph is strongly connected or weakly disconnected
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges, directed=True, detail=True)
print(g.isStronglyConnected())
print(g.isWeaklyConnected())
```
#### Output
```bash
False
True
```
#### You can show the node indegree, outdegree
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = ["ne", "nt", "nw", "no", "nk", "et", "eo", "er", "tw", "tk", "wo", "wr", "or", "ok", "rk"]
g = graph(vertices, edges, directed=True)
print(g.get_indegree("n"))
print(g.get_outdegree("n"))
```
#### Output
```bash
0
5
```
### For directed weighted graph
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = [("ne", 9), ("nt", 6), ("nw", 9), ("no", 1), ("nk", 3), ("et", 15), ("eo", 10), ("er", 13), ("tw", 3), ("tk", 9), ("wo", 8), ("wr", 5), ("or", 3), ("ok", 4), ("rk", 7)]
g = graph(vertices, edges, directed=True, weighted=True)
print(g)
```
#### Output
```bash
Vertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}
Edges : {['ne', 9], ['nt', 6], ['nw', 9], ['no', 1], ['nk', 3], ['et', 15], ['eo', 10], ['er', 13], ['tw', 3], ['tk', 9], ['wo', 8], ['wr', 5], ['or', 3], ['ok', 4], ['rk', 7]}
```
#### You can show all details (adjacency matrix, adjacency list)
```python
from ntwrk import graph
vertices = ["n", "e", "t", "w", "o", "r", "k"]
edges = [("ne", 9), ("nt", 6), ("nw", 9), ("no", 1), ("nk", 3), ("et", 15), ("eo", 10), ("er", 13), ("tw", 3), ("tk", 9), ("wo", 8), ("wr", 5), ("or", 3), ("ok", 4), ("rk", 7)]
g = graph(vertices, edges, directed=True, weighted=True, detail=True)
print(g)
```
#### Output
```bash
Adjacency matrix :
----------------
╒═════════╤═════╤═════╤═════╤═════╤═════╤═════╤═════╕
│ Nodes │ n │ e │ t │ w │ o │ r │ k │
╞═════════╪═════╪═════╪═════╪═════╪═════╪═════╪═════╡
│ n │ 0 │ 9 │ 6 │ 9 │ 1 │ 0 │ 3 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ e │ 0 │ 0 │ 15 │ 0 │ 10 │ 13 │ 0 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ t │ 0 │ 0 │ 0 │ 3 │ 0 │ 0 │ 9 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ w │ 0 │ 0 │ 0 │ 0 │ 8 │ 5 │ 0 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ o │ 0 │ 0 │ 0 │ 0 │ 0 │ 3 │ 4 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ r │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 7 │
├─────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ k │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │
╘═════════╧═════╧═════╧═════╧═════╧═════╧═════╧═════╛
Adjacency list :
--------------
╒═════════╤════════════════════════════════╕
│ Nodes │ ╒════════════════╤═════════╕ │
│ │ │ Adjacent Nodes │ Weights │ │
│ │ ╘════════════════╧═════════╛ │
╞═════════╪════════════════════════════════╡
│ n │ ╒═══╤═══╕ │
│ │ │ e │ 9 │ │
│ │ ├───┼───┤ │
│ │ │ t │ 6 │ │
│ │ ├───┼───┤ │
│ │ │ w │ 9 │ │
│ │ ├───┼───┤ │
│ │ │ o │ 1 │ │
│ │ ├───┼───┤ │
│ │ │ k │ 3 │ │
│ │ ╘═══╧═══╛ │
├─────────┼────────────────────────────────┤
│ e │ ╒═══╤════╕ │
│ │ │ t │ 15 │ │
│ │ ├───┼────┤ │
│ │ │ o │ 10 │ │
│ │ ├───┼────┤ │
│ │ │ r │ 13 │ │
│ │ ╘═══╧════╛ │
├─────────┼────────────────────────────────┤
│ t │ ╒═══╤═══╕ │
│ │ │ w │ 3 │ │
│ │ ├───┼───┤ │
│ │ │ k │ 9 │ │
│ │ ╘═══╧═══╛ │
├─────────┼────────────────────────────────┤
│ w │ ╒═══╤═══╕ │
│ │ │ o │ 8 │ │
│ │ ├───┼───┤ │
│ │ │ r │ 5 │ │
│ │ ╘═══╧═══╛ │
├─────────┼────────────────────────────────┤
│ o │ ╒═══╤═══╕ │
│ │ │ r │ 3 │ │
│ │ ├───┼───┤ │
│ │ │ k │ 4 │ │
│ │ ╘═══╧═══╛ │
├─────────┼────────────────────────────────┤
│ r │ ╒═══╤═══╕ │
│ │ │ k │ 7 │ │
│ │ ╘═══╧═══╛ │
╘═════════╧════════════════════════════════╛
```
### Note
You can use all the methods we use for undirected unweighted graph with other types of graphs as well.
## License
This project is licensed under the MIT LICENSE - see the [LICENSE](https://opensource.org/licenses/MIT) for more details.
Raw data
{
"_id": null,
"home_page": "https://pypi.org/project/ntwrk/",
"name": "ntwrk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "graph",
"author": "khiat Mohammed Abderrezzak",
"author_email": "khiat.dev@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/dd/1d/174773b789fa869975c55c394937699f9ee5fc4c678c84c9e914b1a3d5cc/ntwrk-1.0.1.tar.gz",
"platform": null,
"description": "# ntwrk\n\n\n[![PyPI version](https://badge.fury.io/py/ntwrk.svg)](https://badge.fury.io/py/ntwrk)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\nThis library was created to simplify the concept of graphs by visualizing them in a perfect and clear way, especially for beginners in data structures.\n\n\n## Installation\n\n\nYou can install `ntwrk` via pip:\n\n\n```bash\npip install ntwrk\n```\n\n\n## Usage \n\n\n### For undirected unweighted graph\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges)\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}\n```\n\n\n#### You can show all details (adjacency matrix, adjacency list)\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges, detail=True)\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nAdjacency matrix :\n----------------\n\n\u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2555\n\u2502 Nodes \u2502 n \u2502 e \u2502 t \u2502 w \u2502 o \u2502 r \u2502 k \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 n \u2502 0 \u2502 1 \u2502 1 \u2502 1 \u2502 1 \u2502 0 \u2502 1 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 e \u2502 1 \u2502 0 \u2502 1 \u2502 0 \u2502 1 \u2502 1 \u2502 0 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 t \u2502 1 \u2502 1 \u2502 0 \u2502 1 \u2502 0 \u2502 0 \u2502 1 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 w \u2502 1 \u2502 0 \u2502 1 \u2502 0 \u2502 1 \u2502 1 \u2502 0 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 o \u2502 1 \u2502 1 \u2502 0 \u2502 1 \u2502 0 \u2502 1 \u2502 1 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 r \u2502 0 \u2502 1 \u2502 0 \u2502 1 \u2502 1 \u2502 0 \u2502 1 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 k \u2502 1 \u2502 0 \u2502 1 \u2502 0 \u2502 1 \u2502 1 \u2502 0 \u2502\n\u2558\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u255b\n\nAdjacency list :\n--------------\n\n\u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2555\n\u2502 Nodes \u2502 Adjacent Nodes \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 n \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 e \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 t \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 w \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 e \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 n \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 t \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 t \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 n \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 e \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 w \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 w \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 n \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 t \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 o \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 n \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 e \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 w \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 r \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 e \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 w \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 k \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 n \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 t \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u2558\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255b\n```\n\n\n#### You can add nodes with edges\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges)\nprint(g)\ng.add(\"x\", edge=\"kx\")\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k', 'x'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk', 'kx'}\n```\n\n\n#### You can add nodes and edges\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges)\nprint(g)\ng.add(\"x\")\ng.add_edge(node1=\"k\", node2=\"x\")\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k', 'x'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk', 'kx'}\n```\n\n\n#### You can delete nodes\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\", \"x\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\", \"kx\"]\n\n\ng = graph(vertices, edges)\nprint(g)\ng.delete_node(\"x\")\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k', 'x'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk', 'kx'}\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}\n```\n\n\n#### You can delete edges\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\", \"x\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\", \"kx\"]\n\n\ng = graph(vertices, edges)\nprint(g)\ng.delete_edge(\"k\", \"x\")\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k', 'x'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk', 'kx'}\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k', 'x'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}\n```\n\n\n#### You can show how many nodes are in the graph\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges)\nprint(len(g))\n```\n\n\n#### Output\n\n\n```bash\n7\n```\n\n\n#### You can show how many edges are in the graph\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges)\nprint(g.edge_count())\n```\n\n\n#### Output\n\n\n```bash\n15\n```\n\n\n#### You can show how many degrees are in the graph\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges)\nprint(g.degree_count())\n```\n\n\n#### Output\n\n\n```bash\n30\n```\n\n\n#### You can show the node degree \n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges)\nprint(g.get_degree(\"n\"))\n```\n\n\n#### Output\n\n\n```bash\n5\n```\n\n\n#### You can traverse the graph using different algorithms (DFS, BFS)\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges)\nprint(g.traverse(\"n\"))\nprint(g.traverse(\"n\", algorithm=\"dfs\"))\nprint(g.traverse(\"n\", algorithm=\"bfs\"))\n```\n\n\n#### Output\n\n\n```bash\n['n', 'e', 't', 'w', 'o', 'r', 'k']\n['n', 'k', 'r', 'o', 'w', 't', 'e']\n['n', 'e', 't', 'w', 'o', 'k', 'r']\n```\n\n\n#### You can find the path between two nodes\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges)\nprint(g.find_path(\"n\", \"k\"))\n```\n\n\n#### Output\n\n\n```bash\n['n', 'e', 't', 'w', 'o', 'r', 'k']\n```\n\n\n#### You can check whether the graph is connected or disconnected \n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges)\nprint(g.isConnected())\nprint(g.isDisconnected())\n```\n\n\n#### Output\n\n\n```bash\nTrue\nFalse\n```\n\n\n#### You can create a complete graph\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\n\n\ng = graph(vertices, complete=True)\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nr', 'nk', 'et', 'ew', 'eo', 'er', 'ek', 'tw', 'to', 'tr', 'tk', 'wo', 'wr', 'wk', 'or', 'ok', 'rk'}\n```\n\n\n### For undirected weighted graph\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [(\"ne\", 9), (\"nt\", 6), (\"nw\", 9), (\"no\", 1), (\"nk\", 3), (\"et\", 15), (\"eo\", 10), (\"er\", 13), (\"tw\", 3), (\"tk\", 9), (\"wo\", 8), (\"wr\", 5), (\"or\", 3), (\"ok\", 4), (\"rk\", 7)]\n\n\ng = graph(vertices, edges, weighted=True)\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}\nEdges : {['ne', 9], ['nt', 6], ['nw', 9], ['no', 1], ['nk', 3], ['et', 15], ['eo', 10], ['er', 13], ['tw', 3], ['tk', 9], ['wo', 8], ['wr', 5], ['or', 3], ['ok', 4], ['rk', 7]}\n```\n\n\n#### You can show all details (adjacency matrix, adjacency list)\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [(\"ne\", 9), (\"nt\", 6), (\"nw\", 9), (\"no\", 1), (\"nk\", 3), (\"et\", 15), (\"eo\", 10), (\"er\", 13), (\"tw\", 3), (\"tk\", 9), (\"wo\", 8), (\"wr\", 5), (\"or\", 3), (\"ok\", 4), (\"rk\", 7)]\n\n\ng = graph(vertices, edges, weighted=True, detail=True)\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nAdjacency matrix :\n----------------\n\n\u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2555\n\u2502 Nodes \u2502 n \u2502 e \u2502 t \u2502 w \u2502 o \u2502 r \u2502 k \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 n \u2502 0 \u2502 9 \u2502 6 \u2502 9 \u2502 1 \u2502 0 \u2502 3 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 e \u2502 9 \u2502 0 \u2502 15 \u2502 0 \u2502 10 \u2502 13 \u2502 0 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 t \u2502 6 \u2502 15 \u2502 0 \u2502 3 \u2502 0 \u2502 0 \u2502 9 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 w \u2502 9 \u2502 0 \u2502 3 \u2502 0 \u2502 8 \u2502 5 \u2502 0 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 o \u2502 1 \u2502 10 \u2502 0 \u2502 8 \u2502 0 \u2502 3 \u2502 4 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 r \u2502 0 \u2502 13 \u2502 0 \u2502 5 \u2502 3 \u2502 0 \u2502 7 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 k \u2502 3 \u2502 0 \u2502 9 \u2502 0 \u2502 4 \u2502 7 \u2502 0 \u2502\n\u2558\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u255b\n\nAdjacency list :\n--------------\n\n\u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2555\n\u2502 Nodes \u2502 \u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 Adjacent Nodes \u2502 Weights \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255b \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 n \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 e \u2502 9 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 t \u2502 6 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 w \u2502 9 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 1 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 3 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 e \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 n \u2502 9 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 t \u2502 15 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 10 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 13 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 t \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 n \u2502 6 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 e \u2502 15 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 w \u2502 3 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 9 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 w \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 n \u2502 9 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 t \u2502 3 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 8 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 5 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 o \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 n \u2502 1 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 e \u2502 10 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 w \u2502 8 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 3 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 4 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 r \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 e \u2502 13 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 w \u2502 5 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 3 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 7 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 k \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 n \u2502 3 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 t \u2502 9 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 4 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 7 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u255b \u2502\n\u2558\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255b\n```\n\n\n### For directed unweighted graph\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges, directed=True)\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}\nEdges : {'ne', 'nt', 'nw', 'no', 'nk', 'et', 'eo', 'er', 'tw', 'tk', 'wo', 'wr', 'or', 'ok', 'rk'}\n```\n\n\n#### You can show all details (adjacency matrix, adjacency list)\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges, directed=True, detail=True)\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nAdjacency matrix :\n----------------\n\n\u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2555\n\u2502 Nodes \u2502 n \u2502 e \u2502 t \u2502 w \u2502 o \u2502 r \u2502 k \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 n \u2502 0 \u2502 1 \u2502 1 \u2502 1 \u2502 1 \u2502 0 \u2502 1 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 e \u2502 0 \u2502 0 \u2502 1 \u2502 0 \u2502 1 \u2502 1 \u2502 0 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 t \u2502 0 \u2502 0 \u2502 0 \u2502 1 \u2502 0 \u2502 0 \u2502 1 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 w \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 1 \u2502 1 \u2502 0 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 o \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 1 \u2502 1 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 r \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 1 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 k \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502\n\u2558\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u255b\n\nAdjacency list :\n--------------\n\n\u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2555\n\u2502 Nodes \u2502 Adjacent Nodes \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 n \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 e \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 t \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 w \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 e \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 t \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 t \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 w \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 w \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 o \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 o \u2502 \u2552\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 r \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 r \u2502 k \u2502\n\u2558\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255b\n```\n\n\n#### You can check whether the graph is strongly connected or weakly disconnected \n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges, directed=True, detail=True)\nprint(g.isStronglyConnected())\nprint(g.isWeaklyConnected())\n```\n\n\n#### Output\n\n\n```bash\nFalse\nTrue\n```\n\n\n#### You can show the node indegree, outdegree \n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [\"ne\", \"nt\", \"nw\", \"no\", \"nk\", \"et\", \"eo\", \"er\", \"tw\", \"tk\", \"wo\", \"wr\", \"or\", \"ok\", \"rk\"]\n\n\ng = graph(vertices, edges, directed=True)\nprint(g.get_indegree(\"n\"))\nprint(g.get_outdegree(\"n\"))\n```\n\n\n#### Output\n\n\n```bash\n0\n5\n```\n\n\n### For directed weighted graph\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [(\"ne\", 9), (\"nt\", 6), (\"nw\", 9), (\"no\", 1), (\"nk\", 3), (\"et\", 15), (\"eo\", 10), (\"er\", 13), (\"tw\", 3), (\"tk\", 9), (\"wo\", 8), (\"wr\", 5), (\"or\", 3), (\"ok\", 4), (\"rk\", 7)]\n\n\ng = graph(vertices, edges, directed=True, weighted=True)\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nVertices : {'n', 'e', 't', 'w', 'o', 'r', 'k'}\nEdges : {['ne', 9], ['nt', 6], ['nw', 9], ['no', 1], ['nk', 3], ['et', 15], ['eo', 10], ['er', 13], ['tw', 3], ['tk', 9], ['wo', 8], ['wr', 5], ['or', 3], ['ok', 4], ['rk', 7]}\n```\n\n\n#### You can show all details (adjacency matrix, adjacency list)\n\n\n```python\nfrom ntwrk import graph\n\n\nvertices = [\"n\", \"e\", \"t\", \"w\", \"o\", \"r\", \"k\"]\nedges = [(\"ne\", 9), (\"nt\", 6), (\"nw\", 9), (\"no\", 1), (\"nk\", 3), (\"et\", 15), (\"eo\", 10), (\"er\", 13), (\"tw\", 3), (\"tk\", 9), (\"wo\", 8), (\"wr\", 5), (\"or\", 3), (\"ok\", 4), (\"rk\", 7)]\n\n\ng = graph(vertices, edges, directed=True, weighted=True, detail=True)\nprint(g)\n```\n\n\n#### Output\n\n\n```bash\nAdjacency matrix :\n----------------\n\n\u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2555\n\u2502 Nodes \u2502 n \u2502 e \u2502 t \u2502 w \u2502 o \u2502 r \u2502 k \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 n \u2502 0 \u2502 9 \u2502 6 \u2502 9 \u2502 1 \u2502 0 \u2502 3 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 e \u2502 0 \u2502 0 \u2502 15 \u2502 0 \u2502 10 \u2502 13 \u2502 0 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 t \u2502 0 \u2502 0 \u2502 0 \u2502 3 \u2502 0 \u2502 0 \u2502 9 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 w \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 8 \u2502 5 \u2502 0 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 o \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 3 \u2502 4 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 r \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 7 \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 k \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502 0 \u2502\n\u2558\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u255b\n\nAdjacency list :\n--------------\n\n\u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2555\n\u2502 Nodes \u2502 \u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 Adjacent Nodes \u2502 Weights \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255b \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 n \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 e \u2502 9 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 t \u2502 6 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 w \u2502 9 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 1 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 3 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 e \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 t \u2502 15 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 o \u2502 10 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 13 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 t \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 w \u2502 3 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 9 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 w \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 o \u2502 8 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 r \u2502 5 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 o \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 r \u2502 3 \u2502 \u2502\n\u2502 \u2502 \u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524 \u2502\n\u2502 \u2502 \u2502 k \u2502 4 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u255b \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 r \u2502 \u2552\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2555 \u2502\n\u2502 \u2502 \u2502 k \u2502 7 \u2502 \u2502\n\u2502 \u2502 \u2558\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u255b \u2502\n\u2558\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255b\n```\n\n\n### Note\n\n\nYou can use all the methods we use for undirected unweighted graph with other types of graphs as well.\n\n\n## License\n\n\nThis project is licensed under the MIT LICENSE - see the [LICENSE](https://opensource.org/licenses/MIT) for more details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Sophisticate Graph",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://pypi.org/project/ntwrk/"
},
"split_keywords": [
"graph"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "48204d09e993ae133673041cce82e791120b75c083ab390a189ade72ab6069c5",
"md5": "458a5b28fed601c4aa44cc5a30c6b70f",
"sha256": "bad19f1ae9aa42fd7f684961636757eed363d9a4c2d276297dbf096968eca4f8"
},
"downloads": -1,
"filename": "ntwrk-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "458a5b28fed601c4aa44cc5a30c6b70f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 10623,
"upload_time": "2024-10-23T17:03:24",
"upload_time_iso_8601": "2024-10-23T17:03:24.693792Z",
"url": "https://files.pythonhosted.org/packages/48/20/4d09e993ae133673041cce82e791120b75c083ab390a189ade72ab6069c5/ntwrk-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dd1d174773b789fa869975c55c394937699f9ee5fc4c678c84c9e914b1a3d5cc",
"md5": "92c7119c836ac4b76238dff003fdb9a8",
"sha256": "a46e3b5b792ffd46a40da61b7f749cfc4a1a8719576f3eb81bdeeb10d7dba25a"
},
"downloads": -1,
"filename": "ntwrk-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "92c7119c836ac4b76238dff003fdb9a8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 14542,
"upload_time": "2024-10-23T17:03:27",
"upload_time_iso_8601": "2024-10-23T17:03:27.459954Z",
"url": "https://files.pythonhosted.org/packages/dd/1d/174773b789fa869975c55c394937699f9ee5fc4c678c84c9e914b1a3d5cc/ntwrk-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-23 17:03:27",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "ntwrk"
}