vault backup: 2025-02-03 08:29:48
This commit is contained in:
23
99 Work/0 OneSec/OneSecNotes/Temporary/Graph Theory.md
Normal file
23
99 Work/0 OneSec/OneSecNotes/Temporary/Graph Theory.md
Normal file
@@ -0,0 +1,23 @@
|
||||
I stumbled across this because I was researching what the most efficient way of implementing our FruxelGrid was. In this [StackOverflow answer](https://stackoverflow.com/a/14579347/7705525) I got pointed to graph theory.
|
||||
|
||||
7 Bridges of Königsberg
|
||||
![[Pasted image 20231023150710.png]]
|
||||
# Definitions
|
||||
|
||||
| Definition | Meaning |
|
||||
| -------------- | -------------------------------------------- |
|
||||
| Node / Vertex | The object doing some work |
|
||||
| Edge | Path between two Nodes |
|
||||
| Node degree | Number of edges that touch the node / vertex |
|
||||
| Graph | Combination of Nodes and Vertices / Nodes |
|
||||
| Eulerian Graph | Exactly zero or two nodes have an odd degree |
|
||||
|
||||
# Rules
|
||||
1. Exactly zero or two vertices can have an odd (=uneven) degree
|
||||
|
||||
# Implementation in [[C++]]
|
||||
1. **direct Translation** of the Definition: create a `std::vector` for a list of vertices and a list of edges. The edges themselves are represented as a `std::pair`
|
||||
2. Adjacency List
|
||||
3. Adjacency Matrix
|
||||
|
||||
![[Pasted image 20231023154352.png]]
|
||||
Reference in New Issue
Block a user