mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-30 04:36:08 -04:00
22 lines
1.0 KiB
Markdown
22 lines
1.0 KiB
Markdown
## graphs
|
|
|
|
<br>
|
|
|
|
* graph is a non-linear data structure consisting of vertices and edges.
|
|
* in **undirected graphs**, the edges between any two vertices do not have a direction, indicating a two-way relationship.
|
|
* in **directed graphs**, the edges between any two vertices are directional.
|
|
* in **weighted graphs**, each edge has an associated weight. if the sum of the weights of all edges of a cycle is a negative values, it's a negative weight cycle.
|
|
* the **degree of a vertex** is the number of edges connecting the vertex. in directed, graphs, if the **in-dregree** of a vertex is d, there are **d** directional edges incident to the vertex (and similarly, **out-degree** from the vertex).
|
|
|
|
<br>
|
|
|
|
---
|
|
|
|
### traversals
|
|
|
|
<br>
|
|
|
|
* check **[../trees/#breath-first-search](https://github.com/go-outside-labs/master-python-with-algorithms-py/tree/master/trees#breath-first-search)**
|
|
* and **[../trees/#depth-first-search](https://github.com/go-outside-labs/master-python-with-algorithms-py/tree/master/trees#depth-first-search)**
|
|
|