Skip to content

Commit 026fcf6

Browse files
authored
Update graphs.md
1 parent 3300010 commit 026fcf6

File tree

1 file changed

+38
-23
lines changed

1 file changed

+38
-23
lines changed

notes/graphs.md

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Here, the matrix indicates a graph with vertices A to D. For instance, vertex A
8080

8181
**Benefits**:
8282

83-
- Fixed-time ($O(1)$) edge existence checks.
83+
- Fixed-time ( $O(1)$ ) edge existence checks.
8484
- Particularly suitable for dense graphs, where the edge-to-vertex ratio is high.
8585

8686
**Drawbacks**:
@@ -113,56 +113,71 @@ This list reflects the same graph as our matrix example. Vertex A's neighbors, f
113113
- Edge existence checks can take up to $O(V)$ time in the worst case.
114114
- Potentially consumes more space for dense graphs.
115115

116-
In practice, the choice between these (and other) representations often depends on the graph's characteristics and the specific tasks or operations envisioned.
116+
The choice between these (and other) representations often depends on the graph's characteristics and the specific tasks or operations envisioned.
117117

118118
### Planarity
119119

120-
Planarity is a fundamental concept in graph theory that examines whether a graph can be drawn on a flat surface without any of its edges overlapping. This idea holds significant importance in areas such as circuit design, urban planning, and geography.
120+
Planarity examines whether a graph can be drawn on a flat surface (a plane) without any of its edges crossing. This idea holds significant importance in areas such as circuit design, urban planning, and geography.
121121

122122
#### What is a Planar Graph?
123123

124-
A graph is considered "planar" if there exists a representation of it on a two-dimensional plane where its edges intersect only at their vertices and nowhere in between. Being able to redraw a graph without any edges crossing, even if it starts out messy with overlaps, is what shows if it’s planar or not.
124+
A graph is considered **planar** if there exists a representation (also called a drawing) of it on a two-dimensional plane where its edges intersect only at their vertices and nowhere else. Even if a graph is initially drawn with overlaps or crossings, it may still be planar if it is possible to **redraw** (or **rearrange**) it so that no edges intersect in the interior of the drawing.
125+
126+
An important theoretical result related to planarity is **Kuratowski’s Theorem**, which states that a graph is planar if and only if it does not contain a subgraph that is a subdivision of either $K_5$ (the complete graph on five vertices) or $K_{3,3}$ (the complete bipartite graph on six vertices, partitioned into sets of three).
125127

126128
#### Planar Embedding
127129

128-
A "planar embedding" refers to a way of drawing a graph on a plane so that none of its edges cross each other. If a graph is first drawn with overlapping edges, it’s considered planar if you can rearrange it so no edges cross.
130+
A **planar embedding** refers to a specific way of drawing a graph on a plane so that none of its edges cross each other in the interior. If such a crossing-free drawing exists, the graph is planar. A related fact is **Euler’s Formula** for planar graphs:
131+
132+
$$|V| - |E| + |F| = 2$$
133+
134+
where:
135+
136+
- $|V|$ is the number of vertices,
137+
- $|E|$ is the number of edges,
138+
- $|F|$ is the number of faces (including the "outer" infinite face).
129139

130140
#### Examples
131141

132-
To understand planarity better, let's explore some examples:
142+
I. **Cycle Graphs**
133143

134-
1. **Cycle Graphs**: Graphs like triangles, squares, or hexagons, which are simple loops or cycles, are intrinsically planar. These shapes can always be illustrated without intersecting edges.
144+
Simple cycle graphs (triangles, squares, pentagons, hexagons, etc.) are planar because you can easily draw them without any edges crossing. In the square cycle graph $C_4$ example below, there are no intersecting edges:
135145

136146
```
137147
A-----B
138148
| |
139149
C-----D
140150
```
141151

142-
2. **Complete Graph with Four Vertices ($K_4$)**: This graph has every vertex connected to all other vertices. Despite its complexity, $K_4$ remains planar and resembles a tetrahedron.
152+
II. **Complete Graph with Four Vertices ($K_4$)**
153+
154+
This graph has every vertex connected to every other vertex. Despite having 6 edges, $K_4$ is planar. Its planar drawing can resemble a tetrahedron (triangular pyramid) flattened onto a plane:
143155

144156
```
145-
#
146-
A--------
147-
/ \ |
148-
B---C |
149-
\ / |
150-
D--------
157+
A
158+
/ \
159+
B---C
160+
\ /
161+
D
151162
```
152163

153-
3. **Complete Graph with Five Vertices ($K_5$)**: Unlike $K_4$, $K_5$ cannot be sketched without crossing edges, thus classifying it as non-planar.
164+
III. **Complete Graph with Five Vertices ($K_5$)**
165+
166+
$K_5$ has every one of its five vertices connected to the other four, making a total of 10 edges. This graph is **non-planar**: no matter how you try to arrange the vertices and edges, there will always be at least one pair of edges that must cross. A rough sketch illustrating its inherent crossing is shown below:
154167

155168
```
156-
#
157-
- A -
158-
/ / \ \
159-
/ | | \
160-
B----+-----+---C
161-
\ | | /
162-
\ D-----E /
169+
A
170+
/|\
171+
/ | \
172+
B--+--C
173+
\ | /
174+
\|/
175+
D
176+
|
177+
E
163178
```
164179

165-
In the $K_5$ graph, edges like AD and AE overlap with BC.
180+
Attempting to avoid one crossing in $K_5$ inevitably forces another crossing elsewhere, confirming its non-planarity.
166181

167182
#### Strategies for Assessing Planarity
168183

0 commit comments

Comments
 (0)