You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Standardize
* Update sudoku.md
* Changed links back to old form
* change versions back to original
* add back ipykernel
* clean up, make pre-commit happy
* make pre-commit happy
* Fix typo.
* Rm unnecessary warnings filter.
* Fix footnote format.
* Condense heading.
* More canonical way to create DiGraph.
* Condense headings.
* Fix header level in flow.
* Typo.
* Fix heading level.
* More heading fixes.
* Resolved suggestions
* MAINT: changing white text logo to gray banner (#105)
* Isomorphism tutorial (#83)
Add a high-level notebook introducing isomorphism and the related functionality
in NetworkX
Co-authored-by: Mridul Seth <mail@mriduls.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Mridul Seth <git@mriduls.com>
* Add Python 3.11 to the CI. (#107)
* Rm colab cruft. (#106)
* created and then removed traversal notebook draft 1
* try converting with jupytext for tests again
* test all notebooks except the long exploratory ones
* restore the python versions field in tests
* Fixup missing ref in Dinitz nb.
---------
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Mridul Seth <mail@mriduls.com>
Co-authored-by: Dan Schult <dschult@colgate.edu>
Copy file name to clipboardExpand all lines: content/algorithms/assortativity/correlation.md
+28-22Lines changed: 28 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,16 +22,29 @@ language_info:
22
22
version: 3.8.5
23
23
---
24
24
25
-
# Node assortativity coefficients and correlation measures
25
+
# Node Assortativity Coefficients and Correlation Measures
26
26
27
-
In this tutorial, we will go through the theory of [assortativity](https://en.wikipedia.org/wiki/Assortativity) and its measures.
27
+
In this tutorial, we will explore the theory of assortativity[^1] and its measures.
28
28
29
-
Specifically, we'll focus on assortativity measures available in NetworkX at [algorithms/assortativity/correlation.py](https://github.com/networkx/networkx/blob/main/networkx/algorithms/assortativity/correlation.py):
29
+
We'll focus on assortativity measures available in NetworkX at [`algorithms/assortativity/correlation.py`](https://github.com/networkx/networkx/blob/main/networkx/algorithms/assortativity/correlation.py):
30
30
* Attribute assortativity
31
31
* Numeric assortativity
32
32
* Degree assortativity
33
33
34
-
as well as mixing matrices, which are closely releated to assortativity measures.
34
+
as well as mixing matrices, which are closely related to assortativity measures.
[^2]: M. E. J. Newman, Mixing patterns in networks <https://doi.org/10.1103/PhysRevE.67.026126>
265
271
266
-
[^2]: Foster, J.G., Foster, D.V., Grassberger, P. & Paczuski, M. Edge direction and the structure of networks <https://doi.org/10.1073/pnas.0912671107>
272
+
[^3]: Foster, J.G., Foster, D.V., Grassberger, P. & Paczuski, M. Edge direction and the structure of networks <https://doi.org/10.1073/pnas.0912671107>
Copy file name to clipboardExpand all lines: content/algorithms/dag/index.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,25 +25,24 @@ language_info:
25
25
# Directed Acyclic Graphs & Topological Sort
26
26
27
27
In this tutorial, we will explore the algorithms related to a directed acyclic graph
28
-
(or a "dag" as it is sometimes called) implemented in networkx under `networkx/algorithms/dag.py`.
28
+
(or a "DAG" as it is sometimes called) implemented in NetworkX under [`networkx/algorithms/dag.py`](https://github.com/networkx/networkx/blob/main/networkx/algorithms/dag.py).
29
29
30
30
First of all, we need to understand what a directed graph is.
Copy file name to clipboardExpand all lines: content/algorithms/euler/euler.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,15 @@ kernelspec:
14
14
15
15
# Euler's Algorithm
16
16
17
-
In this tutorial, we will explore the Euler's algorithm and its implementation in NetworkX under `networkx/algorithms/euler.py`.
17
+
+++
18
+
19
+
In this tutorial, we will explore Euler's algorithm and its implementation in NetworkX under [`networkx/algorithms/euler.py`](https://github.com/networkx/networkx/blob/main/networkx/algorithms/euler.py).
20
+
21
+
## Import package
22
+
23
+
```{code-cell}
24
+
import networkx as nx
25
+
```
18
26
19
27
## Seven Bridges of Königsberg
20
28
@@ -37,8 +45,7 @@ In order to have a clear look, we should first simplify the map a little.
37
45
Euler observed that the choice of route inside each land mass is irrelevant. The only thing that matters is the sequence of bridges to be crossed. This observation allows us to abstract the problem even more. In the graph below, blue vertices represent the land masses and edges represent the bridges that connect them.
@@ -73,9 +81,10 @@ Note that every Euler Circuit is also an Euler Path.
73
81
74
82
### Euler's Method
75
83
76
-
Euler[^2] denoted land masses of the town by capital letters $A$, $B$, $C$ and $D$ and bridges by lowercase $a$, $b$, $c$, $d$, $e$, $f$ and $g$. Let's draw the graph based on this node and edge labels.
84
+
Euler[^2] denoted land masses of the town by capital letters $A$, $B$, $C$ and $D$ and bridges by lowercase $a$, $b$, $c$, $d$, $e$, $f$ and $g$. Let's draw the graph based on this node and edge labels.
Copy file name to clipboardExpand all lines: content/algorithms/lca/LCA.md
+18-8Lines changed: 18 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,18 @@ kernelspec:
13
13
14
14
# Lowest Common Ancestor
15
15
16
-
In this tutorial, we will explore the python implementation of the lowest common ancestor algorithm in NetworkX at `networkx/algorithms/lowest_common_ancestor.py`. To get a more general overview of Lowest Common Ancestor you can also read the [wikipedia article](https://en.wikipedia.org/wiki/Lowest_common_ancestor). This notebook expects readers to be familiar with the NetworkX API. If you are new to NetworkX, you can go through the [introductory tutorial](https://networkx.org/documentation/latest/tutorial.html).
16
+
In this tutorial, we will explore the python implementation of the lowest common ancestor algorithm [^1] in NetworkX at [`networkx/algorithms/lowest_common_ancestor.py`](https://github.com/networkx/networkx/blob/main/networkx/algorithms/lowest_common_ancestors.py). This notebook expects readers to be familiar with the NetworkX API. If you are new to NetworkX, you can go through the [introductory tutorial](https://networkx.org/documentation/latest/tutorial.html).
17
+
18
+
## Import packages
19
+
20
+
```{code-cell} ipython3
21
+
import matplotlib.pyplot as plt
22
+
import networkx as nx
23
+
from networkx.drawing.nx_agraph import graphviz_layout
24
+
from itertools import chain, count, combinations_with_replacement
25
+
```
26
+
27
+
+++ {"id": "Z5VJ4S_mlMiI"}
17
28
18
29
## Definitions
19
30
@@ -26,6 +37,7 @@ Before diving into the algorithm, let's first remember the concepts of an ancest
26
37
27
38
-**Lowest Common Ancestor:** For two of nodes $u$ and $v$ in a tree, the lowest common ancestor is the lowest (i.e. deepest) node which is an ancestor of both $u$ and $v$.
28
39
40
+
29
41
## Example
30
42
31
43
It is always a good idea to learn concepts with an example. Consider the following evolutionary tree. We will draw a directed version of it and define the ancestor/descendant relationships.
@@ -34,13 +46,6 @@ It is always a good idea to learn concepts with an example. Consider the followi
34
46
35
47
Let's first draw the tree using NetworkX.
36
48
37
-
```{code-cell}
38
-
import matplotlib.pyplot as plt
39
-
import networkx as nx
40
-
from networkx.drawing.nx_agraph import graphviz_layout
41
-
from itertools import chain, count, combinations_with_replacement
Naive implementation of lowest common ancestor algorithm finds all ancestors of all nodes in the given pairs. Let the number of nodes given in the pairs be P. In the worst case, finding ancestors of a single node will take O(|V|) times where |V| is the number of nodes. Thus, constructing the ancestor cache of a graph will take O(|V|\*P) times. This step will dominate the others and determine the worst-case running time of the algorithm.
191
196
192
197
The space complexity of the algorithm will also be determined by the ancestor cache. For each node in the given pairs, there might be O(|V|) ancestors. Thus, space complexity is also O(|V|\*P).
198
+
199
+
+++
200
+
201
+
## References
202
+
[^1]: [Wikipedia, Lowest common ancestor](https://en.wikipedia.org/wiki/Lowest_common_ancestor)
0 commit comments