graph theory

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/61

flashcard set

Earn XP

Description and Tags

claude

62 Terms

1
New cards

Euler circuit theorem (when does a connected graph have one)?

Every vertex has EVEN degree. If any vertex is odd, there is no Euler circuit.

2
New cards

Euler path (trail) theorem (when does a connected graph have one)?

Exactly 2 vertices have odd degree and all the others are even. More or fewer than 2 odd vertices means no Euler path.

3
New cards

Where must an Euler path start and end?

It starts at one odd-degree vertex and ends at the other odd-degree vertex.

4
New cards

Trick for tracing an Euler trail

Find the 2 odd vertices, start at one, and finish at the other.

5
New cards

Euler trail vs Euler circuit

Euler trail: uses every edge exactly once (open, 2 odd vertices). Euler circuit: uses every edge exactly once AND is closed (returns to the start). All vertices are even.

6
New cards

Eulerian graph

A graph that has an Euler tour (Euler circuit).

7
New cards

Euler tour

A closed Euler trail: a closed walk that uses every edge exactly once.

8
New cards

Walk

A finite sequence of alternating vertices and edges. Edges and vertices CAN repeat.

9
New cards

Length of a walk

The number of edges in the walk. A "walk of length 5" has 5 edges, repeats allowed.

10
New cards

Trail

A walk in which all EDGES are distinct (vertices may repeat).

11
New cards

Path

A walk in which all VERTICES are distinct (so no edge repeats either).

12
New cards

Walk vs trail vs path (quick compare)

Walk: anything goes. Trail: no repeated edges. Path: no repeated vertices.

13
New cards

Trivial walk

A walk containing no edges (length 0).

14
New cards

Closed walk vs open walk

Closed if the start vertex = the end vertex (u = v). Open if u ≠ v.

15
New cards

Circuit

A path that ends at the same vertex where it started.

16
New cards

How do you check a walk or trail of length 5?

Count the edges, not the vertices. A walk A-B-E-C-D-A has 5 edges, so its length is 5.

17
New cards

Maximum trail

The longest trail possible, using as many distinct edges as possible without repeating any edge.

18
New cards

Hamiltonian circuit

A circuit that visits every vertex exactly once and returns to the starting vertex.

19
New cards

Hamiltonian graph

A graph that contains a Hamiltonian circuit.

20
New cards

Euler vs Hamilton (key difference)

Euler is about EDGES (use every edge once). Hamilton is about VERTICES (visit every vertex once, then return to start).

21
New cards

Dirac's theorem

If a connected graph has at least 3 vertices and no multiple edges, and every vertex has degree at least n/2 (n = number of vertices), then the graph is Hamiltonian.

22
New cards

Apply Dirac's theorem: 6 vertices, every vertex has degree at least 3. Hamiltonian?

Yes. n = 6, n/2 = 3, and every degree is at least 3, so it is Hamiltonian.

23
New cards

Does Dirac's theorem fail mean not Hamiltonian?

No. Dirac only guarantees Hamiltonian when the condition holds. If it fails, the graph might still be Hamiltonian, and you check by trial and error.

24
New cards

Degree of a vertex

The number of edges connected to that vertex.

25
New cards

Degree in a directed graph

Written as (in, out): the arrows going into the vertex and the arrows going out of it. Example: A(0,2), B(2,0), C(1,1).

26
New cards

Undirected vs directed edge

Undirected: a plain line, which can be traveled both ways. Directed: an arrow, which can be traveled only one way.

27
New cards

Equivalent graphs: how to check

1) Compare the number of vertices. 2) Compare the number of edges. 3) Only if both are equal, map vertices, starting with the degrees. 4) Check that every edge connection matches.

28
New cards

Do edge shape, length, or vertex position matter for equivalent graphs?

No. Only which vertices are connected by edges matters.

29
New cards

Two graphs differ by one edge (example: one has AB, the other does not). Equivalent?

No. They must have exactly the same set of edges.

30
New cards

Graph

A set of points (vertices) and line segments or curves (edges) connecting them.

31
New cards

Connected graph

Any vertex can be reached from any other vertex by tracing along edges (the graph is in one piece).

32
New cards

Simple graph

A graph with no loops and no multiple (parallel) edges.

33
New cards

Loop

An edge that goes from a vertex back to the same vertex.

34
New cards

Multiple (parallel) edges

Two or more edges that connect the same pair of vertices.

35
New cards

Complete graph

A graph in which every possible edge is drawn between vertices (no multiple edges).

36
New cards

Null graph

A graph with vertices but no edges (a disconnected graph).

37
New cards

Weighted graph

A graph in which each edge has a value (weight), such as distance, cost, or time.

38
New cards

Traveling salesman problem

Finding the Hamiltonian circuit in a weighted graph with the smallest total weight.

39
New cards

Total weight of a Hamiltonian circuit

Add up the weights of all the edges used in the circuit.

40
New cards

Nearest-neighbor algorithm (steps)

1) Start at a vertex and take the edge with the smallest weight. 2) At each new vertex, take the smallest-weight edge to a vertex NOT yet visited. 3) After all vertices are visited, return to the start.

41
New cards

Nearest-neighbor example: circuit A-D-B-F-E-C-A, total weight?

4 + 2 + 5 + 10 + 6 + 15 = 42

42
New cards

Does the nearest-neighbor algorithm always give the best route?

No. It gives a low-cost route, but finding the very best route is hard.

43
New cards

London flights example result (nearest-neighbor)

Total airfare = 160 + 215 + 380 + 480 + 375 + 325 = $1935

44
New cards

Chicago example: which of the 3 routes was cheapest?

Chicago-Philadelphia-Dallas-Washington DC-Atlanta-New York-Chicago, with total 5154 miles (the others were 5197 and 5239).

45
New cards

Planar graph

A graph that can be drawn so that no edges cross except at vertices.

46
New cards

Utilities puzzle (3 utilities, 3 houses)

The graph is K3,3. It cannot be drawn without crossings, so it is NOT planar.

47
New cards

How to show a graph is planar

Redraw it in an equivalent form (move or curve edges) so no edges cross.

48
New cards

Face (planar graph)

A region bounded by edges. The exterior region around the graph also counts as a face (the infinite face).

49
New cards

Euler's formula

For a connected planar graph: v + f = e + 2 (v = vertices, f = faces, e = edges).

50
New cards

Verify Euler's formula: e = 7, v = 5, f = 4

v + f = 5 + 4 = 9 and e + 2 = 7 + 2 = 9, so it is verified.

51
New cards

Does Euler's formula count the infinite face?

Yes. The outside region counts as one face.

52
New cards

Graph coloring rule

Color the vertices so that vertices joined by an edge never have the same color.

53
New cards

Chromatic number

The minimum number of colors needed to color a graph properly.

54
New cards

Four-color theorem

Any map (planar graph) can be colored with at most 4 colors so that neighbors have different colors.

55
New cards

Turning a map into a graph

Each country or region becomes a vertex. Draw an edge between two vertices if the regions share a border.

56
New cards

Scheduling with graph coloring

Each item (club, group) is a vertex. Draw an edge if two items conflict (shared members). Each color is a time slot or day, so the minimum colors = the minimum time slots.

57
New cards

Club scheduling example (6 clubs, shared members): minimum time slots?

  1. Newspaper, Honor society, and Gaming club go in slot 1. Biology, Debate, and Engineering go in slot 2.
58
New cards

Konigsberg bridges problem: Euler circuit possible?

No. The graph has odd-degree vertices, so no Euler circuit exists.

59
New cards

Subway inspector example: can they cover each track once and return to the start?

No. Civic Center has degree 3 (odd), so the graph is not Eulerian and some track must be repeated.

60
New cards

Photographer road example: possible to travel each road exactly once?

Yes. Exactly two odd vertices (Alameda and Dover), so an Euler path exists. It must start at one and end at the other.

61
New cards

Facebook / web graph example

Each vertex is a person or website, and each edge is a friendship or link. Vertices with the most edges rank highest (Google ranking idea).

62
New cards

Why does network structure matter for infection spread (COVID article)?

Shorter path lengths mean faster, sharper infection curves. Longer path lengths flatten the curve.