Skip to content

Commit

Permalink
Updated lecture notes from knowledge check
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinTSchaffer committed May 21, 2024
1 parent f577d48 commit edffc69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.DS_Store
__pycache__
*.pyc
6 changes: 6 additions & 0 deletions OMSCS/Courses/NS/L02 - Relevant Concepts From Graph Theory.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ We can find if a network is fully connected using BFS
## Walks, Paths, and Cycles
> How can we efficiently count the number of walks of length k between nodes s and t?
A walk in a graph is a sequence of successive edge that starts at some node $S$ and ends at some node $T$. A walk may visit the same node more than once.

A path is a walk where intermediate nodes are not visited more than once.

A cycle is a path that stars and ends on the same node.

The number of walks of length $k$ from node $s$ to node $t$ can be retrieved by raising the network's adjacency matrix to the $k$-th power, then grabbing element $(s,t)$: $A^k_{s,t}$.

For $k=1$, the number of walks is either 1 or 0, depending on whether the nodes are directly connected or not.
Expand Down

0 comments on commit edffc69

Please sign in to comment.