Graphs and Trees

Learn to model networks, schedules and relationships as graphs and to reason about them with proofs. You will count degrees with the handshaking theorem, store graphs as lists and matrices, and decide when two graphs are the same. You will study connectivity and when a route can use every edge (Euler) or visit every vertex (Hamilton), then bipartite graphs and matchings, planar graphs and Euler's formula, and graph coloring. The unit ends with trees: their equivalent definitions, rooted and m-ary trees, spanning trees, and minimum spanning trees built with Kruskal's and Prim's algorithms.

IntermediateLesson 10 of 10 in Discrete Mathematics Course

What you will learn

  1. Turn networks and relationships into graphs, use the basic vocabulary precisely, count degrees and edges with the handshaking theorem, and recognize the standard families of graphs.
    • Model a situation as a graph
      Decide what the vertices and edges stand for, and choose between simple graphs, multigraphs, pseudographs, directed graphs and weighted graphs.
    • Count degrees and use the handshaking theorem
      Find degrees, in-degrees and out-degrees, use the handshaking theorem to count edges or prove that a graph cannot exist, and test degree sequences.
    • Recognize special graphs and build new graphs from old ones
      Use complete graphs, cycles, paths, wheels, hypercubes and complete bipartite graphs with their vertex and edge counts, and form subgraphs, complements and unions.
  2. Store graphs as adjacency lists, adjacency matrices and incidence matrices, and decide whether two graphs are isomorphic by building a bijection or finding an invariant that differs.
    • Store a graph as an adjacency list or a matrix
      Write and read adjacency lists, adjacency matrices and incidence matrices for undirected and directed graphs, and choose a suitable representation.
    • Decide whether two graphs are isomorphic
      Use the definition of graph isomorphism, prove that graphs are not isomorphic with invariants, and prove that they are isomorphic with an explicit bijection.
  3. Describe how vertices are linked by walks and paths, find the weak points of a network, and decide when a route through every edge (Euler) or every vertex (Hamilton) exists.
    • Follow walks and paths and test connectivity
      Distinguish walks, trails, paths, circuits and cycles, find components and distances, test connectivity of undirected and directed graphs, and count walks with powers of the adjacency matrix.
    • Find cut vertices, bridges and the connectivity of a network
      Identify the vertices and edges whose failure splits a graph, explain why bridges are the edges on no cycle, and compare vertex connectivity, edge connectivity and minimum degree.
    • Decide when an Euler circuit or trail exists and find one
      State and justify the degree conditions for Euler circuits and Euler trails, construct them by hand, and apply them to route problems.
    • Reason about Hamilton paths and cycles
      Decide by argument whether small graphs have Hamilton paths or cycles, apply Dirac's and Ore's sufficient conditions, and connect Hamilton cycles to Gray codes and the traveling salesperson problem.
  4. Recognize bipartite graphs and test for them, and pair up the two sides of a bipartite graph with matchings, using Hall's theorem and augmenting paths.
    • Recognize and test bipartite graphs
      Use the definition and the odd-cycle characterization of bipartite graphs, and test a graph by two-coloring it.
    • Find matchings and apply Hall's theorem
      Distinguish maximal, maximum, perfect and complete matchings, use Hall's condition to decide whether one side can be fully matched, and enlarge a matching along an augmenting path.
  5. Decide whether a graph can be drawn without crossings using Euler's formula and Kuratowski's theorem, and find chromatic numbers for scheduling and map coloring.
    • Use Euler's formula for planar graphs
      Draw graphs without crossings, count faces, apply Euler's formula and derive the edge bounds for simple planar graphs.
    • Prove that a graph is not planar
      Show nonplanarity with edge-count inequalities and with Kuratowski's theorem, and know which tests are necessary conditions only.
    • Color graphs and find the chromatic number
      Find proper colorings and chromatic numbers with matching upper and lower bounds, use greedy coloring, and apply coloring to scheduling and maps, including the four color theorem.
  6. Prove and use the equivalent characterizations of trees, describe rooted and m-ary trees, and find, count and minimize spanning trees of connected graphs.
    • Recognize trees and use their properties
      Use the equivalent definitions of a tree, prove that a tree with n vertices has n − 1 edges, and count leaves, edges and components of trees and forests.
    • Describe rooted trees and m-ary trees
      Use the vocabulary of rooted trees, apply the counting formulas for full m-ary trees, and relate the height of a tree to its number of leaves.
    • Find and count spanning trees
      Explain why a graph has a spanning tree exactly when it is connected, build spanning trees by removing cycle edges or by depth-first and breadth-first search by hand, and count the spanning trees of small graphs.
    • Build minimum spanning trees with Kruskal's and Prim's algorithms
      Find a spanning tree of least total weight by hand with Kruskal's and Prim's algorithms, and explain why their greedy choices are correct.

Graphs and Trees study guide

6 chapters

1

Model situations with graphs and count degrees

A network becomes easier to analyze when its objects and connections are stated precisely. You will choose the right graph model, count connections at vertices, and use those counts to check whether a proposed graph can exist. Familiar families such as cycles, complete graphs, and hypercubes then provide reusable structures. Their counts also give practice in double counting before you work with more complex networks.

1.1 Vertices, edges, and graph models

A graph keeps the relationships that matter in a situation. Its vertices represent objects, and its edges represent connections. Before drawing anything, state what one vertex means and exactly when an edge exists.

Choose the kind of connection

Write a graph as G=(V,E). The finite, nonempty set V holds the vertices, and E holds the edges. An edge's ends are its endpoints. Two vertices joined by an edge are adjacent, or neighbors; the edge is incident with each endpoint. A vertex with no incident edges is isolated and still belongs to the graph.

Graph modelConnections it records
Simple undirected graphAt most one edge between distinct vertices; no loops
MultigraphSeveral edges may join the same two vertices
PseudographParallel edges and loops are allowed
Directed graphEach edge has a start and an end
Weighted graphEach edge carries a numerical value

An undirected edge uv={u,v} expresses a symmetric connection. A directed edge (u,v) expresses a connection from u to v; reversing it changes the edge. For example, “follows” gives a directed social network because one person may follow another without being followed back. A digraph without parallel edges represents a relation on its vertex set.

Weights add a measured amount, such as travel time in minutes or distance in kilometers. They can be used with directed or undirected edges. Two towns can be adjacent even when the edge between them has a large weight: adjacency records the existence of a link, not its size.

Build a model from a question

Suppose a club contains Ana, Ben, Chen, Dara, and Eli. The friendships are Ana–Ben, Ana–Chen, Ben–Chen, Chen–Dara, and Dara–Eli. Use one vertex per person and one edge per friendship. Friendship is mutual, and the model only records whether it exists, so this is a simple undirected graph with 5 vertices and 5 edges.

Eli's only neighbor is Dara. Dara also has Chen as a neighbor, so Dara can introduce Eli to Chen. The social question has become a question about neighbors. If another club member has no friends in the club, add an isolated vertex for that person; leaving the person out changes the network's connectivity.

For roads, first decide whether each road is one-way. If two separate bridges between the same banks must each be crossed, give them separate edges in a multigraph. If the problem asks for total cable length, attach lengths as weights. A model's choices follow what must be counted or compared.

Read the connections, not the artwork

Moving a vertex or bending an edge leaves a graph unchanged. A crossing of two lines is not a vertex unless it is marked as one. Draw K4 as a square with both diagonals, or as a triangle with a fourth vertex inside joined to all three corners. Both pictures have the same six pairs of adjacent vertices. Only the second is a drawing without crossings.

Key Takeaways

  • Choose vertices and an exact edge rule before drawing the graph.
  • Direction records one-way relationships; weights record amounts.
  • Parallel edges and loops require a model that allows them.
  • Isolated vertices count; unmarked crossings do not.

1.2 Degree sums and possible degree sequences

Counting connections at vertices gives a quick check on an entire graph. The key is to count edge ends consistently, including both ends of a loop.

Count each edge end

The degree deg⁡(v) counts the edges incident with v, with a loop contributing 2. In a simple graph it equals the number of neighbors. Degree 0 means isolated; degree 1 means pendant. Write the smallest degree as δ(G) and the largest as Δ(G).

Handshaking theorem: ∑v∈Vdeg⁡(v)=2∣E∣.

Every edge has two ends. Counting ends vertex by vertex gives the degree sum, while counting them edge by edge gives twice the number of edges. This proves the formula even when loops and parallel edges are present.

In the club graph with edges Ana–Ben, Ana–Chen, Ben–Chen, Chen–Dara, and Dara–Eli, the degrees are 2, 2, 3, 2, and 1. Their sum is 10, so there are 10/2=5 edges. A 4-regular graph on 10 vertices similarly has 10⋅4/2=20 edges. In general a k-regular graph on n vertices has nk/2 edges.

The degree sum is even. After removing all even terms from that sum, the odd terms must still add to an even number. Thus the number of odd-degree vertices is even. Seven people cannot each shake hands with exactly three others: that would require an odd sum of 21.

Test more than parity

A degree sequence lists degrees in decreasing order. It is graphic when a simple graph realizes it. Each entry must lie between 0 and n−1, and the sum must be even. These checks alone are insufficient: (3,3,3,1) has an even sum, but three vertices adjacent to every other vertex force the fourth to have degree 3 as well.

Use the Havel–Hakimi test for a complete decision:

  1. Delete the largest entry d.
  2. Subtract 1 from the next d largest entries.
  3. Sort the remaining sequence and repeat.

Reaching all zeros means graphic. A negative entry, or too few entries to subtract from, means not graphic. The reduction preserves whether a simple graph exists: it accounts for the neighbors of the vertex just removed.

For example,

(3,3,2,2,2)→(2,2,1,1)→(1,1,0)→(0,0).

The sequence is graphic. In contrast, (3,3,3,1)→(2,2,0)→(1,−1) fails. Sort after every reduction; subtracting from arbitrary small entries can reject a valid sequence.

Directed degrees and repeated values

In a digraph, in-degree counts incoming arrows and out-degree counts outgoing arrows. A loop contributes 1 to each. Every arrow has one start and one end, so each total equals ∣E∣, not 2∣E∣. Out-degrees 2, 1, 3, 0 give 6 arrows and a total in-degree of 6.

There is also a useful pigeonhole argument: among n≥2 vertices in a simple graph, two have equal degrees. Degrees range from 0 through n−1, but 0 and n−1 cannot both occur. A vertex adjacent to everyone rules out an isolated vertex, leaving at most n−1 degree values for n vertices.

Key Takeaways

  • The undirected degree sum is twice the edge count; a loop contributes 2.
  • The number of odd-degree vertices is even.
  • An even degree sum is necessary but insufficient for a sequence to be graphic.
  • Havel–Hakimi removes the largest entry, reduces the next entries, and sorts again.
  • Total in-degree and total out-degree each equal the directed edge count.
  • A simple graph with at least two vertices has two equal degrees.

1.3 Graph families and graph operations

Standard graph families give you structures whose counts can be found without listing every edge. Pay attention to what the subscript counts: it does not mean the same thing for every family.

Count the familiar families
GraphVerticesEdgesDegrees
Complete graph Knnn(n−1)/2All n−1
Cycle Cn, n≥3nnAll 2
Path graph Pnnn−1Ends 1, inner vertices 2 when n≥2
Wheel Wn, n≥3n+12nHub n, rim 3
Hypercube Qn, n≥12nn2n−1All n
Complete bipartite Kp,qp+qpqq on one side, p on the other

In Kn, every unordered pair is an edge. There are (n2)=n(n−1)/2 pairs. A round-robin competition with six teams therefore needs 15 games. A cycle closes a row of vertices into a ring; a path leaves the ends unjoined. The one-vertex path P1 has no edges.

The wheel Wn adds a hub to the n-vertex rim Cn and joins it to every rim vertex. There are n rim edges and n spokes, so W5 has 6 vertices and 10 edges. This indexing convention counts rim vertices, not total vertices. For n≥4 the hub and rim degrees differ, while W3=K4 is 3-regular. A graph is regular when all vertices have the same degree.

Read bit strings and two-part graphs

The vertices of Qn are all bit strings of length n. Two are adjacent exactly when one bit differs. Each vertex has n possible bit changes, so its degree is n. The handshaking theorem gives n2n/2=n2n−1 edges. The cube Q3 has 8 vertices and 12 edges; 010 is adjacent to 110, 000, and 011.

In Kp,q, edges join every vertex of one part to every vertex of the other, with none inside a part. Choose one endpoint in p ways and the other in q ways to get pq edges. Using (p+q2) would incorrectly include within-part pairs.

Keep, delete, and complement

A subgraph keeps some vertices and some of the original edges between them. Deleting a vertex also deletes all its incident edges. Deleting an edge keeps its endpoints. An induced subgraph G[W] keeps every original edge whose endpoints both lie in W; a spanning subgraph keeps every vertex.

For a triangle with a pendant edge cd attached at c, the induced subgraph on a,b,c must contain all three triangle edges. The subgraph with only ab and bc on those vertices is valid but not induced.

The complement G‾ keeps the vertices of a simple graph and reverses adjacency between distinct vertices. Its edge count is n(n−1)/2−∣E(G)∣. The complement of C5 has 5 edges and is another 5-cycle, drawn in a different order. The union of two graphs takes the union of their vertex sets and edge sets; an edge appearing in both is included once.

Key Takeaways

  • Use the family’s construction to derive its vertex, edge, and degree counts.
  • Here Pₙ counts vertices and Wₙ counts rim vertices.
  • A hypercube joins bit strings that differ in exactly one position.
  • An induced subgraph keeps every available edge among its chosen vertices.
  • The complement reverses adjacency between distinct vertices.
2

Represent graphs and recognize when two graphs are the same

A graph can be stored without a picture, and the same graph can have many pictures or matrices. Adjacency lists and matrices preserve connections in different forms, each suited to different tasks. You will read those forms, keep their ordering conventions straight, and then compare whole graphs. Isomorphism proofs use explicit vertex matches, while invariants provide quick ways to rule matches out.

2.1 Adjacency lists and graph matrices

A list or matrix records a graph without relying on a picture. Fix the vertex labels and, for a matrix, their order. Otherwise a row or column has no clear meaning.

Store neighbors in a list

Take the graph with vertices a,b,c,d and edges ab,ac,bc,cd. Its adjacency list is:

  • a:b,c
  • b:a,c
  • c:a,b,d
  • d:c

Each undirected edge appears twice, once at each endpoint. Include a row for every vertex, even an empty row for an isolated vertex. In a digraph, list the terminal vertices of outgoing arrows; an incoming arrow alone does not put a vertex in that outgoing list.

Store pairs in an adjacency matrix

With vertex order a,b,c,d, the same graph has

A=(0110101011010010).

The entry aij records how many edges run from row vertex vi to column vertex vj. For a simple undirected graph the matrix is symmetric, has only zeros and ones, and has zero diagonal. Its row sums are degrees: 2, 2, 3, 1 here. The total is 8, twice the four edges.

Parallel edges give entries greater than 1. Count a loop once on the diagonal in this unit. A loop then contributes 1 to a row sum but 2 to the undirected degree. For example, one loop at a and one edge ab give row sum 2 at a but degree 3. If a matrix instead counts loops twice, halve its diagonal entries before drawing loops or counting walks by powers.

For a directed matrix, aij counts arrows from vi to vj. Row sums are out-degrees and column sums are in-degrees. Symmetry is unnecessary. A directed loop contributes 1 to each of those sums.

Store endpoints in an incidence matrix

An incidence matrix has vertices as rows and edges as columns. Its entry is 1 when the vertex is an endpoint of that edge, and 0 otherwise. For the same graph, ordering the columns as ab,ac,bc,cd gives

B=(1100101001110001).

Each column has two ones and each row sum is a degree because this graph has no loops. Parallel edges would give separate identical columns, preserving their separate identities.

Choose and read a representation

An adjacency matrix always has n2 entries. A list uses about n+m storage for n vertices and m edges. With 1,000 vertices of degree 3, the graph has 1,500 edges and the lists have 3,000 neighbor entries; the matrix has 1,000,000 entries. Lists are compact for sparse graphs. Matrices make adjacency a single lookup and support algebraic operations.

To reconstruct an undirected graph, read entries above the diagonal once, then add the diagonal loops. Reading both halves as separate edges would double the graph's edges. For a digraph, read every entry as a directed count. Reordering vertices permutes rows and columns together: different matrices can represent the same graph.

Key Takeaways

  • An adjacency list records neighbors; a directed list records outgoing neighbors.
  • An adjacency matrix needs a fixed vertex order.
  • For simple undirected graphs, the matrix is symmetric and row sums are degrees.
  • Here each loop counts once on the adjacency diagonal.
  • Incidence matrices use vertices as rows and edges as columns.
  • Relabeling a matrix requires the same permutation of rows and columns.

2.2 Proving that graphs have the same structure

Two graph drawings may look different because their vertices have been moved or renamed. An isomorphism makes “the same structure” precise by matching vertices while preserving all adjacency.

State what the matching must do

An isomorphism from G1 to G2 is a bijection f:V1→V2 such that

uv∈E1⟺f(u)f(v)∈E2.

A bijection maps every vertex to one distinct vertex and reaches every target vertex. The double implication requires edges to go to edges and non-edges to non-edges. This is stronger than finding a copy of one graph inside another. Mapping a three-vertex path into a triangle preserves its two edges but introduces an extra adjacency between its ends.

In directed graphs, preserve the direction too: (u,v) must correspond to (f(u),f(v)). Matching an arrow in the opposite direction fails even if its endpoints have been correctly paired.

Rule out impossible matches

An invariant is a property preserved by isomorphism. Compare the vertex and edge counts first, then degree sequences, components, triangle counts, and other short cycles. You can also compare the degrees of the neighbors of a particular vertex, whether it lies on a triangle, or whether it is adjacent to a pendant vertex.

One difference settles nonisomorphism. The cycle C6 and two separate triangles both have six vertices, six edges, and degree sequence (2,2,2,2,2,2). Yet one is connected and the other has two components. Their triangle counts also differ. Equal degree sequences leave important structure undecided.

EvidenceWhat it establishes
One invariant differsThe graphs are not isomorphic
Several checked invariants agreeThese checks have not distinguished the graphs
A bijection preserves adjacency in both directionsThe graphs are isomorphic
Build and verify a bijection

Let G have edges 12, 23, 34, 41, 13. Let H have edges ab,bc,cd,da,bd. Both degree sequences are (3,3,2,2). In G the degree-3 vertices are 1 and 3; in H they are b and d. Try

f(1)=b,f(2)=a,f(3)=d,f(4)=c.

The five edges of G map to ba,ad,dc,cb,bd, all in H. The maps are distinct because f is a bijection. Both graphs have five edges, so these images exhaust all edges of H and also guarantee that non-edges stay non-edges. Without equal edge counts, an edge-only check would be incomplete.

When a first attempt fails, use local structure to restrict another attempt. A degree-1 vertex must map to degree 1, and its neighbor must map to a vertex of the same degree as that neighbor. Such restrictions are far quicker than blindly testing all n! bijections.

For a useful less obvious example, the complement of C5 is also a 5-cycle: its edges can be followed in the order 1–3–5–2–4–1. Map successive vertices of the original cycle to that order. The complement changes which labeled pairs are edges, yet the unlabeled structure remains the same.

Key Takeaways

  • An isomorphism is a bijection preserving both adjacency and nonadjacency.
  • One differing invariant proves nonisomorphism; matching degree sequences alone are insufficient.
  • Use vertex degrees and neighbor structure to narrow possible maps.
  • With equal edge counts, checking every edge under a bijection also settles non-edges.
3

Analyze connectivity, paths and circuits

Routes through a network answer several different questions: whether a destination is reachable, which failures split the network, whether every edge can be used once, and whether every vertex can be visited once. You will separate these demands and learn the evidence each needs. Degree parity settles Euler routes after connectivity is checked; Hamilton cycles require structural arguments or sufficient conditions.

3.1 Walks, paths, and reachable vertices

A route through a graph is a sequence of adjacent vertices, together with the edges used. Different route names tell you what may repeat. Those distinctions matter when a matrix counts routes or a problem asks for a path.

Name the route precisely
RouteRepetition allowed
WalkVertices and edges may repeat
TrailNo edge repeats
PathNo vertex repeats
CircuitA closed trail
CycleA closed walk of length at least 3 with only the start/end repeated

The length is the number of edges used, including repetitions. A walk is closed when its first and last vertices agree. With edges ab,ac,bc,cd, the route a,b,a,c has length 3 but repeats ab, so it is not a trail. The route d,c,a,b is a path; b,a,c,b is a cycle. Rosen uses “path” for a walk and “simple path” for a trail; the definitions in this table fix the meaning used here.

Every walk between distinct vertices contains a path between them. If a vertex repeats, remove the section between its two appearances. The remaining sequence is still a walk with the same ends. Continuing this deletion leaves no repeated vertices. Thus reachability can be tested with paths even when a route was first found as a walk.

Find components and distance

A graph is connected when a path joins every pair of vertices. A component is a maximal connected subgraph: add any other vertex and it is no longer connected. An isolated vertex forms its own component.

Being joined by a path is an equivalence relation. A length-0 path gives reflexivity; reversal gives symmetry; joining routes and removing repetitions gives transitivity. Its equivalence classes are exactly the components.

The distance d(u,v) is the length of a shortest path. In the example, d(d,b)=2 through c. Edge weights are not used in this unweighted distance. In a digraph, strong connectivity requires directed paths in both directions for every pair. Weak connectivity only requires connection after arrow directions are ignored. The arrows a→b,b→c,a→c give weak connectivity, but no route leads from c back to a.

Count walks with matrix powers

For adjacency matrix A, counting loops once on the diagonal,

(Ak)ij counts walks of exactly length k from vi to vj.

The matrix product explains why. Every length-k+1 walk first reaches some vertex vl in k steps, then uses an edge to vj. Summing (Ak)ilalj over l counts all such choices. This is precisely the row-by-column rule.

In the running graph, there is one length-2 walk from a to d: a,c,d. There are three length-3 walks from a to b: a,b,a,b; a,b,c,b; a,c,a,b. Two repeat an edge, so these entries are not path counts.

A path in an n-vertex graph uses at most n−1 edges. Therefore connectivity is equivalent to all off-diagonal entries of A+A2+⋯+An−1 being positive. One zero entry of a single power only rules out that exact length; it may still be possible to reach the vertex in fewer or more steps.

In a simple graph, the diagonal sum of A3 is six times its triangle count. A closed three-edge walk must go around a triangle; each triangle supplies three starting vertices and two directions. Thus a diagonal sum of 6 records one triangle. Loops would introduce other closed three-step walks, so this shortcut uses the simple-graph condition.

Key Takeaways

  • A trail repeats no edge; a path repeats no vertex.
  • Components partition the vertex set by reachability.
  • Strong connectivity respects arrows in both directions; weak connectivity ignores directions.
  • Distance counts edges in a shortest path.
  • Adjacency-matrix powers count walks of an exact length, including repetitions.

3.2 Bridges, cut vertices, and network resilience

A connected network can depend on one link or one central location. To identify that dependence, remove the proposed point of failure and compare the number of components before and after.

Separate vertex failure from edge failure

A cut vertex, or articulation point, is a vertex whose deletion increases the number of components. Deleting it removes all its incident edges too. A bridge, or cut edge, is an edge whose deletion increases the number of components while retaining both endpoints.

Consider two triangles ABC and CDE sharing only C. Removing C leaves the separate edges AB and DE. Thus C is a cut vertex. No edge is a bridge: removing one triangle edge still leaves its endpoints connected along the other two sides.

This example separates the two failures. A network can survive every single edge failure while still depending on one vertex. Conversely, looking only for high-degree vertices misses vulnerabilities: an inner vertex of a path has degree 2 and is a cut vertex. The high-degree hub of a wheel is not a cut vertex, because its deletion leaves the connected rim.

Use cycles to identify bridges

An edge is a bridge exactly when it lies on no cycle.

If uv lies on a cycle, the rest of that cycle gives another route from u to v after its deletion. Any route that used the deleted edge can use that detour, so connectivity is preserved.

In the other direction, suppose deleting uv leaves a path from u to v. That path together with uv forms a cycle. An edge on no cycle therefore has no replacement route and must be a bridge. Every edge of a tree is a bridge because a tree has no cycles.

For a hand check, mark all vertices reachable from one vertex after the deletion. A newly unreachable group certifies a split. For a candidate bridge, looking for a cycle through the edge is often quicker than repeating the full reachability check.

Measure how many failures are needed

The vertex connectivity κ(G) is the fewest vertices whose deletion disconnects the graph or leaves a single vertex. In particular, κ(Kn)=n−1, and disconnected graphs have vertex connectivity 0. A graph is k-connected when κ(G)≥k. A connected graph on at least three vertices with no cut vertex is 2-connected.

The edge connectivity λ(G) is the fewest edges whose deletion disconnects a connected graph; use 0 for an already disconnected graph. For simple graphs with at least two vertices, Whitney's inequality states

κ(G)≤λ(G)≤δ(G).

The right inequality follows by isolating a minimum-degree vertex: delete its δ(G) incident edges. The inequality is a bound, so identifying one such cut gives an upper bound; a smaller cut may exist.

The two-triangle graph has κ=1, λ=2, and δ=2. No single edge disconnects it, but deleting both edges at A isolates A, proving λ=2. Adding redundant links to a network can remove bridges; ensuring survival of any single router failure additionally requires no cut vertex.

Key Takeaways

  • A cut vertex is tested by deleting the vertex and its incident edges.
  • A bridge lies on no cycle.
  • Vertex and edge resilience can differ.
  • For simple graphs, κ(G) ≤ λ(G) ≤ δ(G).

3.3 Using every edge exactly once

An Euler route uses every edge exactly once. It can revisit vertices, so a junction may be passed several times. This is the right model when every street, bridge, or drawn segment must be covered.

Test connectivity and degrees

An Euler circuit finishes where it starts. An Euler trail uses every edge once and may have different endpoints. Ignore isolated vertices when checking whether all edges lie in one component.

Undirected graph with all edges in one componentEuler route
Every degree evenEuler circuit
Exactly two odd degreesOpen Euler trail, from one odd vertex to the other
More than two odd degreesNo Euler trail

Each visit to an intermediate vertex uses one incoming edge and one outgoing edge. These edges pair up. In a circuit the initial departure pairs with the final arrival, so every degree is even. In an open trail only the two endpoints have unpaired uses and hence odd degrees. The handshaking theorem rules out exactly one odd-degree vertex.

Connectivity is a separate requirement. Two disjoint triangles have even degrees everywhere, but no single route can cover both. The Königsberg bridge graph has degrees 5, 3, 3, 3: its four odd vertices rule out both an Euler circuit and an open Euler trail.

Construct a circuit by splicing

Hierholzer's method explains why even degrees are sufficient. Start at a vertex with edges and follow unused edges until stuck. At any other vertex, an arrival leaves an unused departure available because the original degree was even. The trail therefore closes at its start.

If unused edges remain, connectivity provides a vertex on the current circuit touching unused edges. Trace another closed trail from it, then splice the new trail into the old one. Repeat until no edge remains unused.

For the triangles ABC and CDE sharing C:

  1. Trace A,B,C,A.
  2. At C, trace the unused triangle C,D,E,C.
  3. Insert it at C to obtain A,B,C,D,E,C,A.

The result uses all six edges exactly once. Vertex C appears twice before the final return to A, which is permitted. For an open trail, temporarily add an edge between the two odd vertices, build a circuit, then remove the added edge and start just after it.

Fleury's rule is another hand method: avoid a bridge of the still-unused graph unless no other edge is available. Check bridges in the remaining graph, not just the original graph, because earlier steps change the available detours.

Respect arrows in a directed route

For a directed graph, all edges must belong to one weakly connected component. A directed Euler circuit exists exactly when in-degree equals out-degree at every vertex. For an open trail from s to t, s must have one extra outgoing edge, t one extra incoming edge, and every other vertex must be balanced.

In a square with diagonal pr, only p and r have odd degree. The trail p,q,r,s,p,r uses all five edges and ends at the other odd vertex. This is an edge-covering task: visiting every vertex once would ask a different question.

Key Takeaways

  • Euler routes use every edge once and may repeat vertices.
  • All edges must lie in one component.
  • Even degrees give a circuit; exactly two odd degrees give an open trail.
  • Hierholzer builds closed trails and splices them at shared vertices.
  • Fleury tests bridges among the edges still unused.
  • Directed Euler routes require the matching in-degree and out-degree balances.

3.4 Visiting every vertex exactly once

A Hamilton route visits every vertex exactly once. A Hamilton cycle returns to its starting vertex at the end. Extra edges may remain unused, so counting odd degrees does not settle a Hamilton question.

Distinguish the two route problems
RouteMust useMay repeat
Euler trail or circuitEvery edge onceVertices
Hamilton path or cycleEvery vertex once, with the start repeated at the end of a cycleNo other vertices

A Hamiltonian graph has a Hamilton cycle. A leaf rules out such a cycle because a cycle needs two incident edges at each visited vertex. A cut vertex also rules it out: deleting one vertex from a Hamilton cycle leaves a path through every remaining vertex, so the remaining graph must stay connected.

More generally, deleting k≥1 vertices from a Hamiltonian graph leaves at most k components. The deleted vertices break the cycle into at most k pieces. A graph that splits into more pieces fails this necessary condition.

For a small graph, degree-2 vertices can force choices. Both their incident edges must be on a Hamilton cycle. If those forced choices demand three cycle edges at some vertex, or close a smaller cycle before all vertices are included, no Hamilton cycle exists.

Apply sufficient degree conditions

For a simple graph on n≥3 vertices:

  • Dirac's theorem: minimum degree at least n/2 guarantees a Hamilton cycle.
  • Ore's theorem: degree sum at least n for every nonadjacent pair guarantees a Hamilton cycle.

Dirac implies Ore because each of the two degrees is at least n/2. For K4,4, all eight vertices have degree 4, so Dirac applies.

These are sufficient tests. A failed test leaves the outcome open. For example, C7 has degree 2 everywhere, below 7/2, but its rim is already a Hamilton cycle. In a general graph no efficient algorithm deciding every Hamilton-cycle instance is known; the decision problem is NP-complete.

Use bipartite structure

Every step in a bipartite graph switches parts. A cycle therefore uses equal numbers of vertices from each part. Thus K2,3 has no Hamilton cycle, but it has the path y1,x1,y2,x2,y3. A Hamilton path's two part sizes can differ by one because its start and end may be in the larger part.

The Petersen graph has 10 vertices, degree 3 everywhere, and no cut vertex, yet it has no Hamilton cycle. It does have a Hamilton path. Equal degrees and the absence of obvious cut vertices are not enough for a cycle.

Count tours and encode bit changes

In Kn with n≥3, fix the starting vertex and arrange the other n−1 vertices. Reverse directions describe the same undirected cycle, giving (n−1)!/2 Hamilton cycles. For K5 this is 12. The traveling salesperson problem adds edge weights and asks for the least-weight Hamilton cycle.

A Hamilton cycle of Qn gives a cyclic Gray code, listing all length-n bit strings so that consecutive strings, including the last and first, differ in one bit. Such cycles exist for n≥2. For three bits, one order is 000, 001, 011, 010, 110, 111, 101, 100; the closing step also changes one bit.

Key Takeaways

  • Hamilton paths visit every vertex once; cycles also close at the start.
  • Dirac and Ore guarantee cycles when their degree conditions hold.
  • Failure of a sufficient condition leaves Hamiltonicity undecided.
  • Leaves, forced edges, separating vertex sets, and unequal bipartite parts can obstruct cycles.
  • Kₙ has (n − 1)!/2 undirected Hamilton cycles for n ≥ 3.
  • A cyclic Gray code is a Hamilton cycle of a hypercube.
4

Work with bipartite graphs and matchings

Pairing two groups begins with the connections that are allowed between them. A two-coloring reveals whether a graph has the required bipartite structure, while an odd cycle explains a failure. You will then choose disjoint edges to match vertices, test whether enough partners exist for every group, and reroute a partial matching when it can be enlarged. Individual choices and shared constraints both matter.

4.1 Two-coloring and odd cycles

A bipartite graph splits its vertices into two parts so that every edge crosses between them. The parts describe a structural property; the vertices do not have to be drawn in two columns.

Build the two parts

Write the parts as V1 and V2. They are disjoint and together contain every vertex. No edge has both endpoints in one part. Equivalently, assign two colors so every edge joins unlike colors.

Complete bipartite graphs Kp,q have this property by construction. A cycle Cn is bipartite when n is even: alternate colors around the ring. If n is odd, the last vertex gets the same color as its adjacent start, causing a conflict. Thus the absence of triangles alone is insufficient; a 5-cycle also prevents a two-coloring.

A graph is bipartite if and only if it has no odd cycle.

For one direction, each edge of a cycle switches parts. Returning to the starting part takes an even number of switches. For the converse, choose a root in a connected component and separate vertices by even or odd distance from it. An edge joining equal-parity levels would create an odd closed walk, from which an odd cycle can be extracted. With no odd cycles, every edge crosses the distance-parity split.

Test a graph by hand

Start at any vertex, color it A, and color its neighbors B. Work outward, assigning each uncolored neighbor the opposite color. Inspect edges to vertices already colored too. Such edges can expose a conflict even when no new vertex is discovered. Restart at an uncolored vertex if another component remains.

For edges 12, 23, 34, 45, 56, 61, and 14:

  1. Color vertex 1 A.
  2. Color its neighbors 2, 4, 6 B.
  3. Color 3 and 5 A.
  4. Check every edge; each joins the two colors.

The parts are {1,3,5} and {2,4,6}. Adding 13 creates a conflict and the odd cycle 1–2–3–1. The edge exposes a concrete obstruction, not merely a failure of one drawing.

Each component can swap its colors independently. Thus disconnected graphs may have several different valid partitions. Isolated vertices can go in either part because they impose no edge restrictions.

Recognize hidden bipartite structure

Every tree is bipartite: color by the parity of distance from any root. The hypercube Qn is bipartite too. Put strings with an even number of ones in one part and strings with an odd number in the other; changing one bit switches that parity.

If the parts have sizes p and q, there are only pq possible cross-part pairs, so there are at most pq edges in a simple bipartite graph. With p+q=n, this product is largest for parts as equal as possible, giving at most ⌊n2/4⌋ edges. On 10 vertices the maximum is 25, attained by K5,5.

Deleting edges or vertices preserves bipartiteness, because the same two-coloring still works on what remains. Applicants joined to jobs they qualify for naturally give a bipartite model; the next question is whether distinct applicants can be paired with distinct jobs.

Key Takeaways

  • Bipartite means every edge crosses a partition into two parts.
  • A graph is bipartite exactly when it has no odd cycle.
  • Test every component by assigning opposite colors across every edge.
  • Trees and hypercubes are bipartite.
  • A simple bipartite graph on n vertices has at most ⌊n²/4⌋ edges.

4.2 Matchings, Hall’s condition, and augmenting paths

A matching chooses connections without reusing endpoints. In an applicant–job graph, it assigns at most one job to each applicant and at most one applicant to each job. The aim is often to cover a whole side.

Distinguish the goals of a matching
TermMeaning
MatchingA set of edges with no shared endpoints
Maximal matchingNo further edge can be added while keeping all chosen edges
Maximum matchingHas the greatest possible number of edges
Perfect matchingCovers every vertex
Complete matching from V1 to V2Covers every vertex of V1

A maximum matching is maximal, but a maximal one can be too small. In the path a,b,c,d, the matching {bc} blocks both other edges and is maximal. Replacing it with {ab,cd} gives two edges and is perfect.

A perfect matching requires an even total number of vertices. For a bipartite graph it requires equally sized parts, since every matching edge uses one vertex from each part. Equal sizes alone do not guarantee that suitable edges exist.

Check groups, not just individuals

For S⊆V1, let N(S) be all vertices adjacent to at least one member of S. Hall's marriage theorem states that a complete matching from V1 exists exactly when

∣N(S)∣≥∣S∣for every S⊆V1.

The necessity follows from distinct assignments: the members of S need distinct partners within N(S). The sufficiency direction can be proved by strong induction on the number of vertices in V1.

Suppose Ana can do J1 or J2, Bo and Cy can each do only J1, and Dee can do J2, J3, or J4. The set S={Bo,Cy} has only one neighbor, J1. Hall fails because 1<2, even though every applicant has at least one possible job. Ana–J2, Bo–J1, Dee–J3 gives three matches; the deficient pair rules out four, so three is maximum.

For existence, an explicit complete matching is a short certificate: there is no need to inspect every subset once such an assignment is displayed. For nonexistence, one deficient subset is enough.

Enlarge a matching by rerouting

An alternating path switches between edges outside and inside the current matching. An augmenting path has unmatched endpoints. It starts and ends with unmatched edges, so flipping the status of every edge along it increases the matching size by one.

The path a,b,c,d augments {bc}: remove bc and add ab,cd. Internal vertices lose one matched edge and gain one; the two endpoints become newly matched. Berge's theorem says a matching is maximum exactly when no augmenting path exists.

Hall also proves that every k-regular bipartite graph with k≥1 has a perfect matching. Degree sums first show the two parts have equal size. For a subset S, its k∣S∣ incident edges end in N(S), which can receive at most k∣N(S)∣ such edges. Thus Hall holds. In Kn,n, perfect matchings are bijections between the parts, so there are n! of them.

Key Takeaways

  • Maximal means no direct addition; maximum means largest possible.
  • Perfect covers both sides; a complete matching from one side covers that side.
  • Hall tests every subset of the side to be covered.
  • One deficient subset proves nonexistence; an explicit assignment proves existence.
  • Flipping an augmenting path increases matching size by one.
  • A positive-regular bipartite graph has a perfect matching.
5

Draw planar graphs and color graphs

Crossings and conflicts ask different questions about the same connections. A planar drawing avoids crossings, and counting its faces gives restrictions on how many edges it can contain. A coloring assigns different choices to adjacent vertices. You will use certificates for planarity or nonplanarity, then combine lower bounds with actual colorings to establish the fewest time slots or colors needed.

5.1 Faces and Euler’s formula

Planarity asks whether a graph has any drawing without edge crossings. Once such a drawing is available, counting its regions reveals a strong relationship between vertices and edges.

Count every face

A graph is planar if it has a drawing in the plane where edges meet only at shared endpoints. Such a drawing is a plane drawing or embedding. The regions are its faces, including the unbounded outer face.

The degree of a face counts edge sides around its boundary. A bridge touches the same face on both sides and is counted twice. Every edge has two sides, so the sum of all face degrees is 2e. A tree has just the outer face, whose boundary counts every edge twice.

For a connected plane graph with v vertices, e edges, and f faces,

Euler's formula: v−e+f=2.

The cube has 8−12+6=2. In a plane drawing of K4 there are three bounded triangular faces and the outer face, giving 4−6+4=2. Counting only bounded regions would make the formula fail by one.

If the graph has c components, use v−e+f=1+c. For two disjoint triangles, v=6, e=6, and f=3: the two interiors plus the shared outer face. Each component does not get its own separate outer face in the whole drawing.

Understand why the formula holds

A connected acyclic graph is a tree, with e=v−1 and one face. It therefore satisfies Euler's formula. If a connected plane graph has a cycle, remove an edge of that cycle. The remaining graph stays connected and two faces merge. Both e and f fall by one, so v−e+f stays unchanged. Repeating reaches a tree and proves the formula for the original graph.

This argument also explains why a bridge behaves differently: removing it disconnects the graph instead of merging two different faces.

Bound the number of edges

For a simple connected plane graph with v≥3, each face boundary has degree at least 3. Consequently 2e≥3f. Substitute f=2−v+e:

2e≥3(2−v+e),e≤3v−6.

If the graph is also triangle-free, each face has degree at least 4, giving 2e≥4f and e≤2v−4. Bipartite graphs have no triangles, so the stronger bound applies to them. The restrictions matter: parallel edges can bound a two-sided face, and a triangle-free hypothesis cannot be used just because a drawing hides its triangles.

Combine degree and face counts

Suppose a connected planar graph has 20 vertices, all degree 3. First use handshaking to find e=20⋅3/2=30. Then Euler gives f=2−20+30=12. The face count comes after the edge count; degree sums do not count faces directly.

Every simple planar graph has a vertex of degree at most 5. If every degree were at least 6, then 2e≥6v would contradict e≤3v−6 for a component of at least three vertices. Components of one or two vertices already have small-degree vertices. This low-degree fact supports inductive coloring arguments.

Key Takeaways

  • Planarity means some drawing avoids crossings.
  • Count the outer face; a bridge contributes twice to its face boundary.
  • Connected plane graphs satisfy v − e + f = 2.
  • With c components, v − e + f = 1 + c.
  • Simple planar graphs with v ≥ 3 satisfy e ≤ 3v − 6; triangle-free ones satisfy e ≤ 2v − 4.

5.2 Certifying nonplanarity

A crowded drawing can often be rearranged. To establish nonplanarity, give an obstruction that survives every redrawing: too many edges, or a forbidden subdivided structure.

Choose the right inequality

A simple connected planar graph with v≥3 satisfies e≤3v−6. The complete graph K5 has 5 vertices and 10 edges, while the bound allows only 9. This contradiction proves that no plane drawing exists.

For a triangle-free graph, use e≤2v−4. The bipartite graph K3,3 has 6 vertices and 9 edges, exceeding the allowed 8. This explains why the three-utilities puzzle cannot be drawn on a flat plane with all nine connections and no crossings.

A passed inequality leaves the question open. Indeed K3,3 satisfies the weaker bound 9≤3⋅6−6=12 and is still nonplanar. A bound is a necessary condition for planarity, not a construction of an embedding.

For a connected planar graph containing a cycle with girth g≥3, the shortest cycle length, a sharper bound is

e≤g(v−2)g−2.

The Petersen graph has v=10, e=15, and girth 5. The right side is 40/3<15, ruling out planarity. The hypercube Q4 instead fails the triangle-free bound: its 16 vertices and 32 edges exceed 2⋅16−4=28.

Follow subdivided edges

An elementary subdivision replaces an edge uv by two edges uw,wv through a new vertex. Repeating subdivisions stretches edges into paths. This preserves planarity: put each new vertex along its old edge. Conversely, suppressing the inserted degree-2 vertices recovers the old drawing.

Two graphs are homeomorphic when both arise by subdividing a common graph. A subdivided K5 may have many more than five vertices, but it still carries five branch vertices and a path for each original connection.

Kuratowski's theorem: a graph is planar exactly when it contains no subgraph that is a subdivision of K5 or K3,3.

For a K5 obstruction, select five branch vertices and ten connecting paths, one for each pair. For a K3,3 obstruction, select two groups of three branch vertices and nine paths across the groups. The paths must have disjoint interiors; a branch vertex cannot sit inside another connecting path. Paths sharing an internal vertex do not establish the required subdivision.

Use an obstruction inside a larger graph

The forbidden subdivision need only be a subgraph. Extra edges can be ignored, because a plane drawing of the whole graph would also draw every subgraph without crossings. A subdivision of K5 needs branch vertices of degree at least 4. In a 3-regular graph such as the Petersen graph, a Kuratowski search must therefore look for the K3,3 kind.

Both K5 and K3,3 are minimal nonplanar: deleting any one of their edges makes the graph planar. Subdividing them instead preserves nonplanarity. This distinction is useful when a sparse graph passes an edge bound but still contains a stretched forbidden pattern.

Key Takeaways

  • Violating a planar edge bound proves nonplanarity.
  • Passing a necessary edge bound leaves planarity open.
  • Subdividing an edge preserves planarity or nonplanarity.
  • Kuratowski obstructions are subdivisions of K₅ or K₃,₃ inside a subgraph.
  • The connecting paths in the obstruction must have disjoint interiors.

5.3 Coloring conflicts with as few colors as possible

A coloring models choices that must differ at connected pairs. Exams that share students, for example, need different time slots. Color every vertex so that every edge has differently colored endpoints.

Prove both bounds

A proper coloring assigns colors to vertices with no equal-colored adjacent pair. A graph is k-colorable when at most k colors suffice. Its chromatic number χ(G) is the smallest number that works.

A displayed coloring proves an upper bound. To prove equality, also show why fewer colors fail. A clique of size k gives the lower bound χ≥k, since all its vertices are pairwise adjacent. An odd cycle can establish a lower bound of 3 even when there is no triangle.

GraphChromatic number
Knn
Nonempty vertex set with no edges1
Even cycle2
Odd cycle3
Wheel Wn with even rim length n3
Wheel Wn with odd rim length n4

The wheel's hub is adjacent to every rim vertex, so it needs a color absent from the entire rim. The rim needs two or three colors according to parity; then add one for the hub. The clique number ω(G) gives ω(G)≤χ(G), but equality need not hold: C5 has largest clique size 2 and chromatic number 3.

Try greedy coloring

Choose a vertex order. Give each vertex the lowest-numbered color not used by its already colored neighbors. At most Δ(G) colors are blocked, so greedy coloring uses at most Δ(G)+1 colors.

The result depends on order. In the path a,b,c,d, the order a,d,b,c assigns colors 1, 1, 2, 3. The order a,b,c,d uses only 1, 2, 1, 2. Thus a greedy result is a valid upper bound, but it may exceed the chromatic number.

Translate a schedule into a proof

Join exams M, P, C, B, H, E when some student takes both. Suppose the edges are MP, MC, PC, CB, BH, HE, EB. Triangle MPC forces at least three time slots. Assign M and B slot 1, P and H slot 2, and C and E slot 3. Every conflict edge crosses slots, including CB. Three slots work and fewer fail, so the minimum is exactly three.

The same model assigns different radio frequencies to nearby transmitters or different registers to simultaneously needed variables. The edge rule must express an actual conflict; objects can share a color when no edge joins them.

Apply planar coloring results

For a map with connected regions, make one vertex per region and join regions sharing a border segment. Meeting only at a point does not create adjacency. The resulting graph is planar. The four color theorem states that every planar graph can be properly colored with at most four colors. Some need fewer; K4 shows four can be necessary.

The low-degree fact gives an easier six-color proof: remove a vertex of degree at most 5, color the rest by induction, then return the vertex. At most five colors are blocked, leaving a sixth. The five color theorem gives a stronger bound; the four color theorem was first proved with computer assistance. These planar bounds do not apply to arbitrary graphs such as K5.

Key Takeaways

  • A proper coloring separates every adjacent pair.
  • Prove χ = k with a k-coloring and a lower bound of k.
  • Cliques give lower bounds; greedy coloring gives an upper bound of Δ + 1.
  • A greedy coloring can use more colors than necessary.
  • Wheel coloring needs the rim colors plus a new hub color.
  • Every planar graph is at most four-colorable.
6

Characterize trees and build spanning trees

A tree has a route between every pair of vertices and no redundant cycle. Its equivalent descriptions connect unique paths, leaves, and edge counts. Choosing a root adds levels and branching formulas. You will then extract trees that span a larger graph and compare their total weights, using Kruskal and Prim to choose inexpensive links while retaining the mathematical reason each choice is safe.

6.1 Trees, leaves, and equivalent tests

A tree connects all its vertices without a cycle. It has enough edges to connect everything, but no spare edge. This makes trees a useful way to describe networks with no redundant links.

Connect the characterizations

For an undirected graph with n vertices, each of these statements characterizes a tree:

  • It is connected and acyclic.
  • Exactly one path joins every pair of vertices.
  • It is connected and has n−1 edges.
  • It is acyclic and has n−1 edges.
  • It is connected and every edge deletion disconnects it.
  • It is acyclic and every new edge creates exactly one cycle.

Unique paths follow from connectedness and acyclicity. Connectedness provides at least one path. If two distinct paths joined the same pair, their first divergence and later reunion would contain a cycle. Conversely, a cycle gives two paths between two of its vertices.

Every tree edge is a bridge: another path between its endpoints would make a cycle. Adding a missing edge closes the unique existing path between its endpoints into one cycle. These facts explain the names minimally connected and maximally acyclic.

Remove a leaf to prove the edge formula

A leaf has degree 1. Every tree with at least two vertices has at least two leaves. Take a longest path. An endpoint cannot have a neighbor outside the path, because the path could be extended, and cannot have another neighbor on the path, because that would create a cycle. Both endpoints therefore have degree 1.

Now use induction to prove the edge count. A one-vertex tree has zero edges. For a tree on n≥2 vertices, remove a leaf and its one edge. The remaining graph is still connected and acyclic. By induction it has n−2 edges. Returning the leaf gives n−1 edges.

A forest is acyclic and may be disconnected. Each component is a tree. If its components contain n1,…,nc vertices, their edge counts add to ∑(nj−1)=n−c.

Use enough evidence

The count n−1 alone is insufficient. A triangle plus an isolated vertex has four vertices and three edges, but has a cycle and is disconnected. Combine the count with connectedness or with acyclicity. Similarly, connected graphs may have cycles, and forests may have several components.

Suppose a tree has two degree-4 vertices, one degree-3 vertex, and otherwise only leaves. If L is the number of leaves, then n=L+3. Handshaking gives

11+L=2(n−1)=2(L+2),

so L=7. There are ten vertices and nine edges. The equation uses the tree edge count as well as the stated degrees.

Recognize trees in other settings

A tree is bipartite: color its vertices by even or odd distance from any chosen root. Its unique paths prevent conflicting colors. Different shapes may have identical counts; the numbers of nonisomorphic trees on 1 through 7 vertices are 1, 1, 1, 2, 3, 6, 11. On four vertices the two shapes are the path and the star.

In an alkane model, carbon atoms have degree 4 and hydrogen atoms degree 1. A connected molecule with formula CkH2k+2 has 3k+2 atoms and 3k+1 single bonds, so its atom-and-bond graph is a tree. The two carbon skeletons of butane correspond to the four-vertex path and star shapes; attaching hydrogens gives the full fourteen-vertex molecular graphs.

Key Takeaways

  • A tree is connected and acyclic, equivalently it has unique paths.
  • A tree on n vertices has n − 1 edges.
  • Every tree with at least two vertices has at least two leaves.
  • A forest with n vertices and c components has n − c edges.
  • Every tree edge is a bridge, and adding a new edge creates one cycle.
  • The edge count n − 1 needs connectedness or acyclicity to identify a tree.

6.2 Rooted trees and branching counts

Choosing a root gives a tree a direction from one starting vertex outward. It turns its unique paths into parent–child relationships and makes height a precise count of edges.

Describe positions from the root

Every nonroot vertex has one parent, its predecessor on the path from the root. Its successors are its children. Children of the same parent are siblings. The other vertices on the path to the root are ancestors; vertices below it along these paths are descendants. The subtree at a vertex consists of it and all its descendants.

A vertex with children is internal. A rooted leaf has no children. This definition includes a root-only tree, even though its root has undirected degree 0. In a larger rooted tree, the root can have undirected degree 1 and still be internal because it has a child.

The level, or depth, counts edges from the root. The root has level 0. Height is the largest level. A four-vertex path rooted at an end has height 3; rooting it at an inner vertex changes its height to 2. An ordered rooted tree additionally fixes the left-to-right order of each vertex's children.

Count a full m-ary tree

An m-ary tree allows at most m children at an internal vertex. A full m-ary tree requires exactly m at each internal vertex. Binary means m=2; full binary is stronger than binary.

With i internal vertices, the full tree has mi parent-to-child edges. Every vertex except the root is exactly one child, so

n=mi+1,ℓ=n−i=(m−1)i+1.

Thus i=(n−1)/m. For m≥2, you can also use i=(ℓ−1)/(m−1). A full ternary tree with four internal vertices has 13 vertices and nine leaves. If the derived count is not an integer, the proposed full tree cannot exist.

A single-elimination tournament with 64 entrants has one leaf per entrant and one internal vertex per match. With two entrants feeding each match, the tree is full binary. It has 64−1=63 matches. These are total matches, not rounds; the number of rounds concerns height.

Relate height to leaves

For m≥2, an m-ary tree of height h has at most mh leaves. Each level can branch at most m ways. Hence

h≥⌈log⁡mℓ⌉.

For 1,000 leaves in a binary tree, 29=512<1000≤1024=210, so height is at least 10. This lower bound does not force every tree with that leaf count to have height 10; an uneven tree can be taller.

Here balanced means all leaves occur at levels h or h−1. A full balanced m-ary tree attains h=⌈log⁡mℓ⌉. Full alone does not mean balanced: one branch can continue while others stop.

For a comparison decision tree sorting four distinct items, leaves represent all 4!=24 possible orders. Each comparison has two outcomes, so the tree is binary. Since 24<24≤25, at least five comparisons are required in the worst case. The bound concerns the longest root-to-leaf path, not the total number of comparisons written across the entire tree.

Key Takeaways

  • Depth and height count edges; the root is at level 0.
  • A rooted leaf has no children; an internal vertex has children.
  • Full m-ary trees have n = mi + 1 and ℓ = (m − 1)i + 1.
  • For m ≥ 2, height is at least ⌈logₘ ℓ⌉.
  • Full and balanced describe different restrictions.

6.3 Building and counting spanning trees

A spanning tree keeps every vertex of a graph and enough of its original edges to connect them without cycles. It is a simplified network, not a selection of only the easiest vertices to connect.

Remove redundant edges

A graph has a spanning tree exactly when it is connected.

A spanning tree supplies paths between every pair, so its host graph must be connected. Conversely, start with a connected graph. Whenever a cycle remains, delete one of its edges. That edge has a detour around the rest of the cycle, so connectedness survives. The finite process ends with a connected acyclic spanning subgraph: a spanning tree.

Every spanning tree on n vertices has n−1 edges. Starting with m edges therefore requires exactly m−n+1 deletions, regardless of the choices. For K4, delete three of its six edges while maintaining connectedness.

Having n−1 edges alone is insufficient. In a graph containing a triangle and a fourth vertex, choosing the triangle's three edges leaves that fourth vertex isolated. Verify either connectedness or acyclicity along with the count.

Grow a tree from a root

Instead of deleting, add an edge each time you discover a new vertex. One endpoint is in the growing tree and the other has not been visited, so no cycle is created.

  • Depth-first search by hand: keep extending the current route to an unvisited neighbor; back up when it has none.
  • Breadth-first search by hand: add all unvisited neighbors of the root, then expand the newly reached vertices level by level.

Breadth-first levels equal distances from the root. Its tree path to each vertex is therefore a shortest path in the unweighted graph. A depth-first tree need not have that distance property.

For edges 12, 23, 34, 45, 56, 61, 14, start breadth-first at 1 and consider neighbors in increasing order. First add 12, 14, 16. Expand 2 to add 23, then 4 to add 45. All six vertices are reached with five edges. The two omitted edges, 34 and 56, match 7−6+1=2 deletions.

Exchange edges and count trees

Adding an unused graph edge to a spanning tree closes its unique endpoint path into one cycle. Delete another edge on that cycle to obtain a different spanning tree. This exchange changes the chosen links while keeping all vertices connected.

For Cn, a spanning tree omits exactly one cycle edge. Each of the n choices works, giving n spanning trees. Cayley's formula gives nn−2 spanning trees for Kn with n≥2: 16 for K4 and 125 for K5. These count trees on fixed labeled vertices; different labels matter.

For K4 minus one edge, there are (53)=10 three-edge selections. Exactly two are triangles, each leaving the fourth vertex isolated. The other eight are spanning trees. This count requires identifying and excluding the cyclic selections, not assuming all combinations work.

A disconnected graph has no spanning tree. Choose one tree in each component instead to get a spanning forest with n−c edges for c components. No edges between the original components are available to join those trees.

Key Takeaways

  • A spanning tree exists exactly when the graph is connected.
  • Cycle-edge deletion preserves connectivity and removes m − n + 1 edges in total.
  • Growing to new vertices builds a spanning tree; breadth-first paths minimize edge count from the root.
  • Adding an unused edge and deleting another cycle edge exchanges spanning trees.
  • Cₙ has n spanning trees; Kₙ has nⁿ⁻² labeled spanning trees for n ≥ 2.

6.4 Choosing a spanning tree of minimum weight

When edges carry costs or lengths, different spanning trees can have different totals. A minimum spanning tree connects all vertices with the smallest possible sum of edge weights.

Make safe greedy choices

For a minimum spanning tree, or MST, every vertex must be included and exactly n−1 edges are chosen. Minimize their total, not the weight of just one link or one route.

MethodEligible edgeShape during construction
KruskalLightest remaining edge that creates no cycleA forest, possibly several pieces
PrimLightest edge from the current tree to an outside vertexOne growing tree

Kruskal's algorithm sorts all edges by increasing weight. Accept an edge if its endpoints are in different current components; otherwise skip it. Stop at n−1 accepted edges. Sharing one endpoint with a chosen edge is allowed: only closing a cycle is forbidden.

Prim's algorithm starts at any vertex. At every step consider all edges crossing from the current tree to the outside, and choose a lightest one. This need not touch the most recently added vertex. Stop when every vertex belongs to the tree.

Work through the same network

Five towns have candidate cable links in kilometers: AB 5, AC 3, BC 4, BD 7, CD 9, CE 8, DE 6, BE 10.

Kruskal processes the edges in this order:

  1. Accept AC, weight 3.
  2. Accept BC, weight 4.
  3. Skip AB, weight 5: A and B are already linked through C.
  4. Accept DE, weight 6, creating a second piece.
  5. Accept BD, weight 7, joining the pieces.

Four edges connect the five towns. Their sum is 3+4+6+7=20 km.

Prim from A accepts AC, then BC. The tree now contains A, B, C, and the lightest outward edge is BD, weight 7. After D joins, DE of weight 6 becomes eligible and is chosen. Prim's accepted weights need not increase: an inexpensive edge can become available later. Both methods give the same tree here.

Explain why the choices work

A cut splits all vertices into two nonempty groups. The cut property says a lightest crossing edge belongs to some MST; if it is uniquely lightest, every MST contains it.

To see why, take an MST omitting the chosen edge and add it. The new cycle crosses the cut again through another edge. Replacing that crossing edge by the chosen one preserves a spanning tree and cannot increase its weight. If the chosen edge is strictly lighter, omitting it would contradict minimality.

During either algorithm, choose a cut crossed by no previously accepted edge. The exchange can then preserve earlier choices. For Prim, use the current tree versus the outside. For Kruskal, use one current component versus the rest.

Distinct edge weights guarantee a unique MST. Ties can allow several trees, all with the same optimal total. Reversing the comparisons gives maximum spanning trees.

An MST need not give shortest routes between towns. In the example its A-to-D route has length 3+4+7=14 km, while the graph offers A–B–D of length 5+7=12 km. Minimizing total installed cable and minimizing each journey are different objectives.

Key Takeaways

  • An MST minimizes the sum of spanning-tree edge weights.
  • Kruskal sorts edges and rejects cycle-closing choices.
  • Prim chooses a lightest edge crossing from its tree to an outside vertex.
  • The cut property justifies the greedy steps while preserving earlier choices.
  • Distinct edge weights guarantee a unique MST; ties can allow several.
  • An MST need not provide shortest routes between pairs of vertices.

Graphs and Trees examples

6 Walkthroughs

1

Build a network and check its counts

12 steps
Choose a model, count degrees, test a sequence, and compare standard graph families.
  1. 1
    IntroductionTurn a situation into connections

    A graph model begins with two choices: what one vertex represents and exactly when an edge joins two vertices. Once these are clear, degree counts can check the model without relying on its drawing.

    We will model candidate links between six sensors, count their endpoints, and then compare the network with standard graph families. Keep the distinction between an object, a connection, and an amount on a connection visible throughout.

  2. 2
    ExampleState the sensor model

    Six sensors A through F can communicate directly over links AB, AC, BC, CD, DE, DF, EF. One vertex represents one sensor. One undirected edge means that direct communication is possible in both directions.

    Each possible link is either present or absent, and no sensor is linked to itself, so a simple graph fits. The network has six vertices and seven edges. The crossing or length of lines in a sketch does not add connections.

  3. 3
    ExplanationAdd information only when it matters

    Suppose a link takes a stated number of milliseconds to transmit a message. Keep the same graph and place that value on its edge as a weight. If communication works only one way, use an arrow for that direction instead.

    If two distinct cables join the same sensors and either cable may fail separately, represent them as parallel edges. Model those separate connections explicitly; a single edge would hide the redundancy being studied.

  4. 4
    ChallengeChoose the graph for cable failures

    Two routers have three separate cables between them. A failure study must track which cables survive. What graph model keeps the needed information?

    ---reveal---

    Use a multigraph with two vertices and three parallel edges, one per cable. A simple graph would keep only whether the routers are connected and would lose the count of surviving independent cables. A drawing can show the edges as three different curves without introducing extra vertices.

  5. 5
    ExampleCount the sensor degrees

    Return to the seven sensor links AB, AC, BC, CD, DE, DF, EF. The degrees are A: 2, B: 2, C: 3, D: 3, E: 2, F: 2.

    The sum is 2+2+3+3+2+2=14=2⋅7. Each link appears at both its endpoints. Exactly two vertices, C and D, have odd degree, agreeing with the even-count rule for odd-degree vertices. The degrees measure links, not the transmission-time weights they might carry.

  6. 6
    ExampleReduce a proposed sequence

    Can a simple graph realize (4,3,3,2,2,2)? Its sum is 16, but evenness is only a first check.

    Remove 4 and reduce the next four entries. The remaining entries become (2,2,1,1,2); sorting gives (2,2,2,1,1). This first Havel–Hakimi step accounts for all four neighbors of the deleted vertex. It leaves a smaller sequence whose graphic status is the same.

  7. 7
    ExampleFinish the sequence test

    Continue from (2,2,2,1,1). Delete 2 and reduce the next two entries to obtain (1,1,1,1). Delete 1 and reduce one entry, then sort, giving (1,1,0). One more reduction gives (0,0).

    All entries have reached zero, so the original sequence is graphic. Sorting after each step matters because the next reduction must use the current largest entries, not their old positions.

  8. 8
    ChallengeFind a missing degree

    A graph has 11 edges. Five of its six vertex degrees are 4, 4, 3, 3, and 2. What is the last degree?

    ---reveal---

    The total degree is 2⋅11=22. The five known degrees total 16, so the missing degree is 6. This cannot be a simple graph on six vertices, whose degrees are at most 5; loops or multiple edges would be needed for such degree data. The degree-sum calculation and the simple-graph restriction are separate checks.

  9. 9
    ExplanationCount a wheel from its construction

    Build W4 from a square rim and one new hub. It has five vertices. The four rim edges and four spokes give eight edges.

    The hub has degree 4, and each rim vertex has degree 3. The degree sum 4+4⋅3=16 checks the edge count. The subscript 4 counts the rim vertices here, not all vertices; reading it as the total would shift both vertex and edge counts.

  10. 10
    ConnectionKeep a subgraph or reverse adjacency

    In the sensor network, the induced subgraph on C, D, E contains CD and DE, but not CE: that link was absent. An induced subgraph must keep every available link between the chosen vertices.

    A complement instead keeps all six vertices and takes exactly the missing pairs. Six vertices have (62)=15 possible pairs, so the seven-edge network has an eight-edge complement. It replaces the edge set instead of merely deleting selected edges.

  11. 11
    ChallengeCombine a family count with handshaking

    The hypercube Q4 has one vertex for each four-bit string. Find its vertex count and edge count.

    ---reveal---

    There are 24=16 strings. Each has four neighbors, found by changing one of its four bits, so the degree sum is 16⋅4=64. Divide by two to get 32 edges. Counting 64 edges would count each bit-change connection once from each of its two ends.

  12. 12
    RecapMatch the count to the model

    When checking a network, first settle whether a link is directed, repeated, or weighted. Then count vertices and edge ends using that model. Degree parity can reject impossible data quickly; a degree-sequence test checks the remaining simple-graph restrictions.

    For a standard family, derive counts from its construction. For a subgraph or complement, state which vertices stay and which pairs are retained. This gives a clear basis for later route and connectivity questions.

2

Record a graph and verify a vertex renaming

10 steps
Read lists and matrices, then prove an isomorphism instead of relying on a similar drawing.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionSeparate representation from structure
  2. 2
    ExampleWrite all five neighbor lists
  3. 3
    ExplanationRead rows and columns by their labels
  4. 4
    ChallengeRead an incidence column
  5. 5
    TipCompare before trying every map
  6. 6
    ExampleChoose images using local structure
  7. 7
    ExampleCheck that every edge survives
  8. 8
    ChallengeFind an invariant that settles a mismatch
  9. 9
    ChallengeInterpret a simultaneous row and column swap
  10. 10
    RecapUse the right certificate
3

Analyze routes through a network

16 steps
Use one small network to explore repetition, weak links, Euler routes, and Hamilton obstructions.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionAsk what the route must cover
  2. 2
    ExampleTrack repetitions in a route
  3. 3
    ExampleCount a two-step walk without drawing
  4. 4
    ChallengeFind distance and classify a walk
  5. 5
    ExampleRemove a central vertex
  6. 6
    Key InsightLocate the edge without a detour
  7. 7
    ChallengeRepair one failure without fixing all failures
  8. 8
    ExplanationTest Euler parity in the original graph
  9. 9
    ExampleBuild the route in pieces
  10. 10
    ChallengeUse degree pairing to reject a claim
  11. 11
    ConnectionBalance arrows for a directed trail
  12. 12
    ExplanationWhy the Euler trail is not a Hamilton cycle
  13. 13
    TipApply a theorem without reversing its logic
  14. 14
    ChallengeSeparate a path from a cycle in two parts
  15. 15
    ChallengeCompare edge coverage and vertex coverage
  16. 16
    RecapChoose evidence for the route you need
4

Find a valid split and improve an assignment

10 steps
Two-color a graph, detect a shared shortage, and enlarge a matching by changing earlier pairs.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionFrom allowed pairs to compatible pairs
  2. 2
    ExampleBuild a two-coloring from one vertex
  3. 3
    ChallengeExpose an odd-cycle conflict
  4. 4
    ExplanationChoose pairs without reusing endpoints
  5. 5
    Key InsightWhy maximal can still be too small
  6. 6
    ExampleTrace the alternating route
  7. 7
    ExampleFlip the path
  8. 8
    ChallengeFind a Hall obstruction
  9. 9
    ChallengeConnect the split to a complete assignment
  10. 10
    RecapLocate the reason an assignment stops
5

Count faces, find obstructions, and color conflicts

13 steps
Use Euler’s formula and graph structure to justify drawings and minimum color counts.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionUse evidence that survives redrawing
  2. 2
    ExampleCount the outside region
  3. 3
    ExampleAttach a pendant edge
  4. 4
    ChallengeHandle a disconnected drawing
  5. 5
    ExplanationChoose the stronger applicable bound
  6. 6
    ExampleStretch a forbidden graph
  7. 7
    ChallengeRead a Kuratowski certificate
  8. 8
    ExampleBuild a conflict graph for sessions
  9. 9
    ExampleComplete the coloring proof
  10. 10
    TipWatch a greedy order use an extra color
  11. 11
    ChallengeColor a wheel
  12. 12
    ChallengeCombine planar and clique bounds
  13. 13
    RecapMatch each claim with its certificate
6

Build trees and minimize their total weight

17 steps
Prove tree properties, count rooted branches, extract a spanning tree, and trace Kruskal and Prim.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionKeep every vertex with no redundant cycle
  2. 2
    ExplanationWhy a tree has unique paths
  3. 3
    ExampleRemove a leaf and use induction
  4. 4
    ChallengeFind the number of leaves
  5. 5
    ExplanationChoose a root and count edges downward
  6. 6
    ExampleCount children in a full branching tree
  7. 7
    ChallengeUse leaf count to bound height
  8. 8
    ExampleExtract a spanning tree by deletion
  9. 9
    ConnectionGrow a tree by discovering vertices
  10. 10
    ChallengeCount a small set of spanning trees
  11. 11
    ExampleList a new weighted network
  12. 12
    ExampleTrace Kruskal’s choices
  13. 13
    ExampleTrace Prim from a different start
  14. 14
    Key InsightUse an exchange to justify a cheap edge
  15. 15
    ChallengeUpdate the optimum after a weight change
  16. 16
    ChallengeCompare a spanning tree with a tour
  17. 17
    RecapCheck structure before optimizing

Graphs and Trees practice questions

60 Practice Questions in 6 sets

Set 1: Paths, failures, and whole-network routes10 Practice Questions

Question 1 of 10

A simple graph has edges jk,kl,lj,lm. What kind of route is m,l,j,k,l, using the most restrictive valid name?
  1. A path
  2. A cycle
  3. An open trail
  4. A closed walk
Show answerHide answer
Answer: C
The four edges ml,lj,jk,kl are distinct, so the route is a trail. Vertex l repeats, preventing it from being a path, and its endpoints differ, so it is open. A cycle would need to return to its start and repeat no other vertex.

Question 2 of 10

A simple graph has edges uv,uw,vx,wx,xy and adjacency matrix A. What is (A3)uy?
  1. 2
  2. 0
  3. 1
  4. 3
Show answerHide answer
Answer: A
A three-step walk ending at y must reach its only neighbor x after two steps. From u to x there are two such routes, through v or w, giving 2. Counting only one shortest route misses the second distinct choice of intermediate vertex.

Question 3 of 10

Two disjoint four-cycles are joined by one extra edge, from a vertex of one to a vertex of the other. How many bridges and cut vertices does the resulting graph have?
  1. 1 bridge and 1 cut vertex
  2. 2 bridges and 2 cut vertices
  3. 0 bridges and 2 cut vertices
  4. 1 bridge and 2 cut vertices
Show answerHide answer
Answer: D
The joining edge is the only edge on no cycle, so it is the only bridge. Its two endpoints are cut vertices: deleting either separates the opposite cycle from the remaining path of its own cycle. Counting only one cut vertex overlooks the equal role of the other joining endpoint.

Question 4 of 10

A graph has two disjoint complete graphs on four vertices. Add edges a1b1 and a2b2 between them, where the four named endpoints are distinct. What are its vertex and edge connectivities?
  1. κ=1, λ=2
  2. κ=2, λ=2
  3. κ=2, λ=3
  4. κ=3, λ=3
Show answerHide answer
Answer: B
Deleting the two joining edges disconnects the cliques, while either one alone leaves the other connection. No single vertex disconnects the graph because the joining endpoints are distinct and each clique remains connected. Deleting a1,a2 does disconnect it, giving both connectivities 2; minimum degree 3 is only an upper bound.

Question 5 of 10

A connected undirected graph has degree sequence (6,4,4,4,2,2,2). What kind of Euler route exists?
  1. An Euler circuit
  2. An Euler path only
  3. No Euler route
  4. A free-ended trail
Show answerHide answer
Answer: A
Every degree is even and the graph is connected, so an Euler circuit exists. An open Euler trail with distinct endpoints would require exactly two odd-degree vertices, and there are none. Its starting vertex may vary, but after all edges are used it must return to that start.

Question 6 of 10

A directed graph has all edges in one weak component. Its out-degree minus in-degree values at p,q,r,s are −1,0,1,0. What are the endpoints of an open Euler trail?
  1. Start p, end r
  2. Start q, end s
  3. Start r, end p
  4. Start r, end s
Show answerHide answer
Answer: C
The start needs one more departure than arrival, so it is r with difference 1. The end needs one more arrival, so it is p with difference −1. Reversing those endpoints reverses the degree balances and would require traversing some directed edges against their arrows.

Question 7 of 10

A graph consists of three vertex-disjoint triangles. Add one edge between the first and second triangles and one between the second and third, using distinct endpoints on the middle triangle. How many additional edges are needed at minimum to permit an Euler circuit? Parallel edges are allowed.
  1. 1
  2. 3
  3. 4
  4. 2
Show answerHide answer
Answer: D
The two joining edges make four distinct endpoints odd, while the graph is already connected. One new edge can change parity at only two vertices, so at least two are needed. Duplicating each joining edge makes all four degrees even, attaining two; one extra edge cannot repair all four odd degrees.

Question 8 of 10

A simple graph has 14 vertices and minimum degree 7. What does Dirac’s theorem guarantee?
  1. An Euler circuit exists.
  2. A Hamilton cycle exists.
  3. A Hamilton path but no cycle exists.
  4. Every spanning tree has weight 7.
Show answerHide answer
Answer: B
The threshold is 14/2=7, and every degree meets it, so Dirac guarantees a Hamilton cycle. This degree lower bound says nothing about whether every degree is even. It therefore does not guarantee an Euler circuit, which depends on parity as well as connectivity.

Question 9 of 10

What Hamilton routes does K4,6 have?
  1. Neither a Hamilton path nor a Hamilton cycle
  2. A Hamilton path but no Hamilton cycle
  3. A Hamilton cycle and a Hamilton path
  4. A Hamilton cycle but no Hamilton path
Show answerHide answer
Answer: A
A path in a bipartite graph alternates parts, so its part counts can differ by at most one. Here they differ by two, ruling out a Hamilton path and hence a Hamilton cycle. A difference of one would allow an open alternating path, but these larger parts cannot fit that pattern.

Question 10 of 10

Start with triangle rst. For each of r, s, t, add two new vertices adjacent exactly to the other two triangle vertices. Does the resulting graph have a Hamilton cycle?
  1. Yes; every vertex has degree at least two and the graph is connected.
  2. Yes; each original vertex can join its two attached vertices in a cycle.
  3. No; the graph has an odd number of vertices and every cycle is even.
  4. No; the six new vertices cannot all fit between the three original vertices.
Show answerHide answer
Answer: D
Removing r,s,t leaves six isolated vertices, more than the three removed vertices. A Hamilton cycle can break into at most three path pieces after three deletions, so it is impossible. Minimum degree 2 and connectedness are necessary but insufficient; the graph also contains triangles, so odd-order parity is not the obstruction.
Set 2: Models, degrees, and representations10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A delivery network records one-way links between depots and the travel time on each link. Which graph model records both features?
  1. An undirected weighted graph
  2. A directed weighted graph
  3. A directed unweighted graph
  4. An undirected unweighted graph
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A vertex has three incident nonloop edges and two loops. What is its degree?
  1. 5
  2. 6
  3. 10
  4. 7
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A simple 5-regular graph has 12 vertices. How many edges does its complement have?
  1. 36
  2. 30
  3. 60
  4. 66
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

Apply two Havel–Hakimi reductions, sorting after each, to (4,4,3,3,2,2). What sequence remains?
  1. (2,1,1,0)
  2. (2,2,1,1)
  3. (1,1,1,1)
  4. (1,1,0,0)
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Under the convention that Wₙ has an n-vertex rim, how many edges does W9 have?
  1. 9
  2. 16
  3. 18
  4. 20
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A graph is K4,7. How many edges must be added to make it a complete graph on the same vertices?
  1. 28
  2. 27
  3. 44
  4. 55
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

In a directed adjacency matrix ordered r,s,t,u, the row for s is (1,0,1,1). What is the out-degree of s?
  1. 3
  2. 1
  3. 2
  4. 4
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

An undirected adjacency matrix counts each loop once on its diagonal. A vertex’s row sum is 6 and its diagonal entry is 2. What is its degree?
  1. 6
  2. 10
  3. 12
  4. 8
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A club graph contains an isolated member. A redraw omits that member but retains every edge. What changes?
  1. The vertex count falls, but component count stays fixed.
  2. The vertex and component counts both fall by one.
  3. The component count falls, but vertex count stays fixed.
  4. The edge count falls along with the vertex count.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Graph G has edges 12, 13, 23, 34, 45, 56, 46. Graph H has edges ab,ac,bc,bd,de,df,ef. Which image list (f(1),…,f(6)) defines an isomorphism?
  1. (a,c,b,d,e,f)
  2. (a,b,c,d,e,f)
  3. (a,c,b,e,d,f)
  4. (a,d,b,c,e,f)
Show answerHide answer

Save this lesson to see this answer.

Set 3: Bipartite structure, matching, and planarity10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A graph contains a cycle of length 11. What can be concluded about bipartiteness?
  1. It might be bipartite.
  2. It is still bipartite.
  3. It has eleven parts.
  4. It is not bipartite.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A simple bipartite graph has 13 vertices. What is its maximum possible edge count?
  1. 39
  2. 78
  3. 42
  4. 84
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Applicants A, B, C, D can do jobs as follows: A: 1, 2; B: 1, 2; C: 1, 2; D: 3, 4, 5. What is the maximum matching size?
  1. 3
  2. 2
  3. 4
  4. 5
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

In the path p, q, r, s, t, u, a matching contains qr and st. How many matching edges are there after augmenting along the path from p to u?
  1. 2
  2. 3
  3. 4
  4. 5
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Tasks A, B, C, D have neighbors A: 1, 2; B: 2, 3; C: 3, 4; D: 1. Starting from matching {A1,B2,C3}, what perfect matching results from flipping the augmenting path beginning at D?
  1. {D1,A2,B3,C4}
  2. {D1,A2,B2,C4}
  3. {D1,A1,B3,C4}
  4. {D1,A2,B4,C3}
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A bipartite graph is 3-regular with eight vertices in each part. How many edges does any perfect matching contain?
  1. 3
  2. 12
  3. 24
  4. 8
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A connected plane graph has 18 vertices, all of degree 4. How many faces are in the drawing?
  1. 18
  2. 20
  3. 19
  4. 36
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A plane graph has three connected components, 16 vertices, and degree sum 38. How many bounded faces does it have?
  1. 4
  2. 5
  3. 6
  4. 7
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A simple bipartite graph has 12 vertices and 21 edges. Can it be planar?
  1. No; it exceeds the triangle-free planar edge bound.
  2. Yes; it satisfies the general planar edge bound.
  3. No; every bipartite graph with cycles is nonplanar.
  4. Yes; its two parts provide a plane drawing.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Every edge of K5 is subdivided once. What are the resulting vertex count, edge count, and planarity status?
  1. 10 vertices, 20 edges, nonplanar
  2. 15 vertices, 20 edges, nonplanar
  3. 15 vertices, 20 edges, planar
  4. 15 vertices, 15 edges, nonplanar
Show answerHide answer

Save this lesson to see this answer.

Set 4: Trees, branching, and spanning choices10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A tree has two degree-3 vertices, one degree-4 vertex, and all other vertices of degree 1. How many vertices does it have?
  1. 6
  2. 8
  3. 9
  4. 10
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A full 5-ary tree has seven internal vertices. How many leaves does it have?
  1. 28
  2. 35
  3. 36
  4. 29
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A rooted ternary tree has 150 leaves. What height lower bound follows from branching?
  1. h≥4
  2. h≥5
  3. h≥6
  4. h≥50
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A graph consists of a four-cycle and a five-cycle sharing exactly one vertex. How many spanning trees does it have?
  1. 9
  2. 20
  3. 16
  4. 25
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

How many spanning trees remain after one specified edge is deleted from K6?
  1. 432
  2. 1080
  3. 864
  4. 1290
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A forest has 23 vertices and 7 components. How many edges does it have?
  1. 16
  2. 15
  3. 22
  4. 30
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A connected graph has 9 vertices and 12 edges. A spanning tree T is chosen. Add an edge xy not in T; the T-path from x to y has length 5. How many different spanning trees can be formed by deleting one edge from the enlarged subgraph?
  1. 6
  2. 4
  3. 5
  4. 8
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A weighted graph has AB 2, AC 3, BC 4, CD 5, DE 6, BD 7, CE 8, AE 10. Which edge does Kruskal first reject?
  1. AC
  2. CD
  3. DE
  4. BC
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

For edges AB 2, AC 3, BC 4, CD 5, DE 6, BD 7, CE 8, AE 10, what is Prim’s edge order starting at E?
  1. DE,CD,BC,AB
  2. AB,AC,CD,DE
  3. DE,CD,AC,AB
  4. DE,BD,AB,AC
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A weighted graph has edges AB 2, AC 3, BC 4, CD 9, DE 6, BD 7, CE 8, AE 10. What is its MST weight?
  1. 16
  2. 18
  3. 20
  4. 22
Show answerHide answer

Save this lesson to see this answer.

Set 5: Combine structure with counting10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

Two simple graphs have the same degree sequence, but one has four triangles and the other has three. Can they be isomorphic?
  1. Yes; the degree sequence determines every adjacency.
  2. No; triangle count is preserved by isomorphism.
  3. Yes; equal triangle parity is all that matters.
  4. No; all triangle-containing graphs have unique labels.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A simple graph on eight vertices has complement degree sequence (5,5,4,4,3,3,2,2). How many edges does the original graph have?
  1. 14
  2. 12
  3. 16
  4. 28
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A connected graph has two vertices x and y whose deletion leaves four components. What can be concluded about Hamilton paths and cycles?
  1. It may have a Hamilton path, but no Hamilton cycle.
  2. It may have a Hamilton cycle, but no Hamilton path.
  3. It has neither a Hamilton path nor a Hamilton cycle.
  4. Both route types are guaranteed by connectedness.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

The left part is {a,b,c,d,e}. Their neighbors are a,b,c: {1,2}; d: {2,3}; e: {3,4}. What is the maximum matching size?
  1. 2
  2. 3
  3. 5
  4. 4
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A graph contains a subdivision of K3,3 but has fewer than 2v−4 edges. Is it planar?
  1. Yes; the triangle-free edge bound proves planarity.
  2. Yes; subdivision removes all crossing obstructions.
  3. No; every graph below that edge bound is nonplanar.
  4. No; the forbidden subdivision establishes nonplanarity.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

Take a seven-cycle and add two new vertices, each adjacent to every cycle vertex and also adjacent to each other. What is the chromatic number?
  1. 5
  2. 3
  3. 4
  4. 6
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A connected simple graph has 15 vertices and 14 edges. What happens when any one of its edges is removed?
  1. It loses a cycle but stays whole.
  2. It splits into two components.
  3. It splits into 14 components.
  4. It stays connected and acyclic.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A full ternary tree has 31 vertices and all leaves at levels h or h − 1. What are its leaf count and height?
  1. 20 leaves and height 3
  2. 21 leaves and height 4
  3. 21 leaves and height 3
  4. 30 leaves and height 4
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A connected undirected graph has six odd-degree vertices. Parallel edges may be added between any pair of vertices. What is the minimum number needed for an Euler circuit?
  1. 2
  2. 5
  3. 3
  4. 6
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A connected weighted graph has distinct edge weights and MST T. A nontree edge of weight 11 is reduced to 3. Its endpoint path in T has edge weights 2, 5, 8, 6. How does an MST change?
  1. Replace the weight-8 path edge by the changed edge.
  2. Replace the weight-2 path edge by the changed edge.
  3. Keep T because it was optimal before the change.
  4. Add the changed edge without deleting any edge.
Show answerHide answer

Save this lesson to see this answer.

Set 6: Proofs and transfer across graph topics10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

How many edges does Q6 have?
  1. 64
  2. 128
  3. 192
  4. 384
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

An undirected adjacency matrix counts loops once. It has diagonal sum 5, and all its entries sum to 29. How many edges does it represent?
  1. 12
  2. 14
  3. 19
  4. 17
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

An even cycle receives a new chord joining two vertices whose distance around one arc is 4. Is the new graph bipartite?
  1. Yes; the original cycle had even length.
  2. No; that arc and the chord form a 5-cycle.
  3. Yes; every new cycle has length 4.
  4. No; any chord destroys bipartiteness.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A 4-regular bipartite graph has 24 vertices. After deleting the edges of one perfect matching, is the remaining graph guaranteed to have another perfect matching?
  1. Yes; the remaining graph is 3-regular and bipartite.
  2. No; removing a perfect matching isolates every vertex.
  3. Yes; each remaining component must be a cycle.
  4. No; Hall’s condition can fail in a positive-regular bipartite graph.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A connected simple plane graph has every face, including the outer face, triangular and every vertex of degree 4. How many vertices does it have?
  1. 4
  2. 8
  3. 6
  4. 12
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A graph is an odd cycle with one new vertex joined to every cycle vertex. Is it planar, and what is its chromatic number?
  1. Planar, with chromatic number 3
  2. Planar, with chromatic number 4
  3. Nonplanar, with chromatic number 3
  4. Nonplanar, with chromatic number 4
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A graph consists of a complete graph on five vertices and a four-cycle sharing exactly one vertex. How many spanning trees does it have?
  1. 500
  2. 125
  3. 129
  4. 625
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A graph consists of two cliques of size five joined by a single bridge. Does it have a Hamilton path, a Hamilton cycle, both, or neither?
  1. A Hamilton cycle, but no Hamilton path
  2. Both a Hamilton path and a Hamilton cycle
  3. Neither a Hamilton path nor a Hamilton cycle
  4. A Hamilton path, but no Hamilton cycle
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A connected weighted graph has exactly one cycle. Its cycle-edge weights are 4, 9, 7, 6, and all other edges are bridges. Which cycle edge is omitted in an MST?
  1. The weight-4 edge
  2. The weight-6 edge
  3. The weight-7 edge
  4. The weight-9 edge
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A simple graph has adjacency matrix A, tr⁡(A3)=24, and every off-diagonal entry of A+A2+⋯+A7 is positive. It has eight vertices. What do these data establish?
  1. It is connected and has four triangles.
  2. It is connected and has eight triangles.
  3. It is disconnected and has four triangles.
  4. It is connected and has twenty-four triangles.
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

104 Key Terms, each with its definition

A

Adjacency list
An adjacency list records neighbors for each vertex; for a directed graph, it records the endpoints of outgoing edges.
An empty neighbor list preserves an isolated vertex instead of silently dropping it from the graph.
Adjacency matrix
An adjacency matrix uses one ordered vertex set for rows and columns and records edge counts between each ordered pair.
A 1 in row A, column B records an arrow from A to B when the matrix represents a digraph.
Adjacent vertices
Adjacent vertices are vertices joined by an edge; in a simple graph, each is also called a neighbor of the other.
If exams A and B share a student, their vertices are adjacent in the conflict graph.
Ancestor and descendant
An ancestor lies earlier on a vertex’s path from the root; the later vertex is a descendant of that ancestor.
The root is an ancestor of every other vertex, even when they are not its immediate children.
Augmenting path
An augmenting path alternates unmatched and matched edges and has unmatched endpoints, allowing a matching to grow by one.
Flipping the three edges of an unmatched–matched–unmatched path replaces one pair with two.

B

Balanced rooted tree
A balanced rooted tree here has all its leaves at its maximum level or at the level immediately before it.
A full balanced binary tree with ten leaves has height 4, while a more uneven full tree can be taller.
Bipartite graph
A bipartite graph has a partition into two vertex sets such that every edge has one endpoint in each set.
Applicants and jobs form the two parts when edges record which jobs each applicant can perform.
Bipartition
A bipartition is a division of all vertices into two disjoint parts with no edge joining vertices inside either part.
Swapping the two colors within one component gives another valid bipartition of a disconnected graph.
Branch vertex
A branch vertex in a graph subdivision is one of the original vertices, at which the replacement edge paths meet.
The five branch vertices of a subdivided K₅ each require at least four incident edges in the host graph.
Breadth-first spanning tree
A breadth-first spanning tree grows level by level from a root, preserving shortest unweighted paths from that root.
Discovering every immediate neighbor before extending to the next level gives the correct root distances.
Bridge
A bridge is an edge whose deletion increases the number of connected components; equivalently, it lies on no cycle.
The only link between two otherwise separate network clusters is a bridge because no detour exists.

C

Cayley’s formula
Cayley’s formula counts the spanning trees of a complete graph on n fixed labeled vertices as n raised to the power n − 2.
For K₅, the formula gives 125 trees; it counts labels separately rather than only different tree shapes.
Chromatic number
The chromatic number is the smallest number of colors needed for a proper vertex coloring, denoted by chi.
A triangle needs three colors, and a valid three-coloring of the whole graph can make that bound exact.
Circuit
A circuit is a closed trail: it finishes at its starting vertex and does not repeat an edge.
Tracing two edge-disjoint triangles through their shared vertex produces a circuit with a repeated junction.
Clique number
The clique number is the size of a largest complete subgraph, providing a lower bound on the chromatic number.
An odd cycle of length five has clique number 2 but still needs three colors, so the bound can be strict.
Complete graph
A complete graph joins every pair of distinct vertices, giving each vertex degree one less than the vertex count.
A competition in which every pair of seven teams plays once has the graph of a complete tournament schedule.
Connected component
A connected component is a maximal connected subgraph, consisting of all vertices mutually reachable by paths.
An isolated vertex counts as a component even though no edge joins it to another vertex.
Cut
A cut partitions all vertices into two nonempty sets; its crossing edges have exactly one endpoint in each set.
For Prim, the current tree vertices and all outside vertices form the cut used at the next step.
Cut property
The cut property says a lightest edge across any cut belongs to some MST, and a uniquely lightest one belongs to every MST.
Exchanging a heavier crossing edge on a cycle explains why a uniquely cheapest connection is forced.
Cut vertex
A cut vertex is a vertex whose deletion, along with all incident edges, increases the number of connected components.
The shared vertex of two otherwise disjoint triangles is a cut vertex, although none of their edges is a bridge.
Cycle
A cycle is a closed walk of length at least three whose only repeated vertex is the shared start and end.
Traversing A, B, C, A around a triangle is a cycle; traversing the same edge out and back is not.
Cycle graph
A cycle graph consists of at least three vertices joined in a single ring, with degree 2 at every vertex.
A six-stop route with links only between consecutive stops and from last to first forms a cycle graph.

D

Degree
The degree of an undirected vertex counts incident edge ends, with a loop contributing two to the total.
A vertex with two ordinary incident edges and one loop has degree 4, although its loop is one edge.
Degree sequence
A degree sequence is the list of a graph’s vertex degrees arranged in nonincreasing order.
Sorting the degrees 1, 3, 2, 2 gives the sequence (3, 2, 2, 1), preserving repeated degrees.
Degree-preserving map
A degree-preserving map sends each vertex to a vertex with the same degree, a necessary restriction on an isomorphism.
A pendant vertex can map only to another degree-1 vertex when constructing an isomorphism.
Depth-first spanning tree
A depth-first spanning tree grows by following unvisited neighbors along a route and backing up when no new neighbor remains.
A depth-first tree can follow a long route to a vertex that was much nearer the root in the original graph.
Dirac’s theorem
Dirac’s theorem guarantees a Hamilton cycle in a simple graph on at least three vertices when each degree is at least half the order.
A simple graph with ten vertices and minimum degree 5 meets Dirac’s sufficient condition.
Directed graph
A directed graph is a graph whose edges have ordered endpoints, specifying an initial and a terminal vertex.
An arrow from A to B may represent A following B even when B does not follow A.

E

Edge
An edge is a connection with specified endpoints; it may carry a direction, a weight, or a separate identity.
Two distinct bridges between the same banks are separate edges when each bridge must be counted.
Edge connectivity
Edge connectivity is the fewest edge deletions that disconnect a connected graph; it is 0 when the graph is already disconnected.
A cycle needs two edge deletions to disconnect it, so its edge connectivity is 2.
Euler circuit
An Euler circuit is a closed trail that uses every edge exactly once, starting and ending at the same vertex.
A connected graph with only even degrees permits a closed route through all its edges.
Euler trail
An Euler trail is a trail that uses every edge of a graph exactly once, with endpoints that may differ.
A route covering every cable once may revisit a junction, because the restriction is on edges.
Euler’s formula
Euler’s formula relates vertex, edge, and face counts in a plane graph: the alternating sum equals 2 when connected.
A connected plane graph with 9 vertices and 14 edges has 7 faces after including the outer face.

F

Face
A face is a region of a plane drawing’s complement, including the unbounded region outside all bounded faces.
Two disjoint triangles have two bounded faces and one shared outer face, giving three altogether.
Face degree
The degree of a face counts edge sides along its boundary, counting an edge twice when the face lies on both sides.
A plane tree’s single face has degree twice the edge count because every edge borders it on both sides.
Fleury’s rule
Fleury’s rule traces an Euler route by avoiding a bridge of the unused-edge graph whenever another edge is available.
An edge that was not originally a bridge can become one after earlier route edges are used.
Forest
A forest is an undirected graph with no cycles, so each connected component is a tree, including any isolated vertex.
A forest with twelve vertices and three components has nine edges, one fewer per component.
Four color theorem
The four color theorem states that every planar graph has a proper vertex coloring using at most four colors.
The planar graph K₄ needs all four colors, while a planar path with an edge needs only two.
Full m-ary tree
A full m-ary tree is a rooted tree in which each internal vertex has exactly m children; other vertices have none.
With five internal vertices, a full ternary tree has sixteen vertices, including eleven leaves.

G

Girth
The girth of a graph containing a cycle is the length of its shortest cycle, measured by its number of edges.
A graph may contain a seven-cycle yet have girth 3 if a triangle also appears elsewhere.
Graph complement
The complement of a simple graph keeps its vertices and joins exactly the distinct vertex pairs that were nonadjacent.
On five vertices, a graph with three edges has a complement with seven of the ten possible pairs.
Graph distance
The distance between reachable vertices is the number of edges in a shortest path joining them in an unweighted graph.
A two-edge route gives distance at most 2 even if one of its edges has a large numerical weight.
Graph invariant
A graph invariant is a property or quantity that has the same value for every graph isomorphic to the given graph.
Triangle count distinguishes a triangle-containing graph from an otherwise similar triangle-free graph.
Graph isomorphism
A graph isomorphism is a bijection of vertex sets that preserves adjacency and nonadjacency, and direction when present.
Renaming the vertices of a square in cycle order gives an isomorphism to another labeled square.
Graphic sequence
A graphic sequence is a sequence of nonnegative integers realized as the degrees of some simple graph.
The sequence (2, 2, 2, 2) is graphic because a cycle on four vertices realizes all its entries.
Gray code
A cyclic Gray code lists every fixed-length bit string once, with one bit changing at each step, including the return to the start.
A Hamilton cycle through the cube’s bit-string vertices gives a cyclic three-bit Gray code.
Greedy coloring
Greedy coloring processes vertices in an order and gives each the smallest-numbered color not used by already colored neighbors.
Changing the order on a path can make greedy coloring use three colors even though two suffice.

H

Hall’s condition
Hall’s condition requires each subset of one bipartite part to have at least as many distinct neighbors as its own size.
A group of four tasks sharing only three eligible machines violates Hall even if none has an empty list.
Hamilton cycle
A Hamilton cycle is a cycle visiting every vertex once before returning to its starting vertex.
A Hamilton cycle in a bipartite graph alternates parts and therefore uses equal numbers from both parts.
Hamilton path
A Hamilton path is a path that visits every vertex of its graph exactly once and may leave many edges unused.
A chain of visits through all towns is Hamiltonian as a path even when it cannot close into a tour.
Handshaking theorem
The handshaking theorem states that the degree sum of an undirected graph equals twice its edge count.
A degree sum of 30 certifies 15 edges even when the graph contains loops or parallel edges.
Havel–Hakimi test
The Havel–Hakimi test decides whether a degree sequence is graphic by repeatedly deleting and reducing its largest entries.
After removing a largest entry of 3, reduce the next three largest entries by 1 and sort again.
Height
The height of a rooted tree is the largest vertex level, measuring the longest root-to-vertex path in edges.
A path of five vertices rooted at an end has height 4, since its longest route uses four edges.
Hierholzer’s method
Hierholzer’s method builds an Euler circuit by forming closed trails of unused edges and splicing them at shared vertices.
After tracing one loop of a network, start another at a visited vertex that still touches unused edges.
Hypercube
A hypercube graph joins bit strings of one fixed length whenever they differ in exactly one bit position.
In the four-dimensional hypercube, 0010 is adjacent to 1010, but not to 1110.

I

In-degree
The in-degree of a directed vertex is the number of arrows ending at it, including one count for each loop.
If four other accounts follow an account, those four arrows contribute 4 to its in-degree.
Incidence
Incidence is the relationship between an edge and a vertex that is one of its endpoints.
The edge joining towns R and S is incident with both town vertices, regardless of its weight.
Incidence matrix
An incidence matrix uses vertex rows and edge columns, recording whether each vertex is an endpoint of each edge.
In a loopless undirected graph, every edge column has exactly two ones, one for each endpoint.
Induced subgraph
An induced subgraph keeps a chosen vertex set and every original edge whose two endpoints lie in that set.
Selecting three vertices of a complete graph induces a triangle; none of its edges can be omitted.
Internal vertex
An internal vertex of a rooted tree has at least one child; a rooted leaf instead has no children.
A root with one child is internal even though its degree in the undirected tree equals 1.

K

Kruskal’s algorithm
Kruskal’s algorithm builds an MST by considering edges in increasing weight order and accepting those that do not create a cycle.
Two separate chosen components may grow before a later accepted edge joins them into one tree.
Kuratowski’s theorem
Kuratowski’s theorem characterizes planar graphs by the absence of a subgraph that is a subdivision of K₅ or K₃,₃.
Extra edges can be ignored when a forbidden subdivided pattern is already visible within the graph.

L

Leaf
A leaf of an unrooted tree is a degree-1 vertex; a tree with at least two vertices has at least two such vertices.
The two end vertices of a longest path in a tree must be leaves, or the path could extend or close a cycle.
Level
The level, or depth, of a rooted vertex is the number of edges on its path from the root, whose level is zero.
A vertex reached after three parent-to-child links is at level 3, regardless of its number of siblings.

M

Matching
A matching is a set of graph edges with pairwise disjoint endpoints, so each covered vertex belongs to just one chosen pair.
Choosing applicant A for job J prevents another chosen edge from reusing either A or J.
Maximal matching
A maximal matching cannot be enlarged by simply adding an edge while keeping all its present choices.
The middle edge of a four-vertex path is a maximal matching, since both other edges touch it.
Maximum matching
A maximum matching has the largest edge count among all matchings in the graph, even those using different edges.
On a four-vertex path, choosing both outer edges gives two matches and exceeds the middle-edge matching.
Minimum degree
The minimum degree is the smallest vertex degree in a graph, written as the lowercase delta symbol.
Deleting all edges at a minimum-degree vertex supplies an upper bound on edge connectivity.
Minimum spanning tree
A minimum spanning tree is a spanning tree of a connected weighted graph with the smallest possible sum of edge weights.
The network of town links with the least total cable may give a longer journey between two towns than another available route.
Multigraph
A multigraph is a graph that allows distinct parallel edges joining the same pair of vertices.
Two separate cables between the same routers remain two edges in a multigraph model.

N

Neighbor set
The neighbor set of a vertex set consists of all vertices adjacent to at least one member, counting each neighbor once.
Two applicants who can both do only job J have a shared neighbor set of size 1, not 2.
Nonisomorphic graphs
Nonisomorphic graphs are graphs for which no vertex-set bijection preserves adjacency in both directions.
A six-cycle and two disjoint triangles are nonisomorphic because their component counts differ.
Nonplanar graph
A nonplanar graph admits no drawing in the plane with edges meeting only at shared endpoints, regardless of how it is rearranged.
K₅ is nonplanar because its ten edges exceed the nine allowed for a simple planar graph on five vertices.

O

Odd cycle
An odd cycle is a cycle with an odd number of edges, and its presence prevents a graph from being bipartite.
A triangle-free graph can still contain a seven-cycle, which rules out a two-coloring.
Ore’s theorem
Ore’s theorem guarantees a Hamilton cycle in a simple graph of order at least three when every nonadjacent degree sum reaches the order.
For eight vertices, check that every nonadjacent pair has degree sum at least 8 before applying Ore.
Out-degree
The out-degree of a directed vertex is the number of arrows starting at it, including one count for each loop.
An account following three accounts has out-degree 3 even if none of them follows it back.

P

Parent and child
A parent is the vertex immediately preceding its child on the path from the root; each nonroot vertex has one parent.
Two vertices below the same immediate predecessor are siblings, even if their own subtrees differ.
Path
A path is a walk with no repeated vertex, so it also has no repeated edge and has at most one fewer edge than vertices.
A path through five different stations uses four edges, even when a longer walk also joins its ends.
Path graph
A path graph consists of vertices joined in one open chain; here its subscript counts vertices, not edges.
The path graph on six vertices has five edges, with two ends and four internal vertices.
Perfect matching
A perfect matching covers every vertex, requiring an even total vertex count and equally sized parts in a bipartite graph.
A pairing of all six vertices of a six-cycle uses three alternating cycle edges.
Planar graph
A planar graph has at least one drawing in the plane in which edges meet only at their common endpoints.
Redrawing a diagonal outside a square shows that the crossed square drawing of K₄ is still planar.
Plane drawing
A plane drawing is a particular crossing-free drawing of a planar graph, with its edge placement determining face boundaries.
One planar graph may have different plane drawings while Euler’s formula fixes their face count.
Prim’s algorithm
Prim’s algorithm builds an MST by repeatedly taking a lightest edge from the current tree to a vertex outside it.
An edge between two outside vertices remains ineligible even if it is the graph’s lightest unused edge.
Proper vertex coloring
A proper vertex coloring assigns a color to every vertex of a loopless graph, giving different colors to adjacent vertices.
Exams sharing students must get different time-slot colors, while nonadjacent exams may share one.
Pseudograph
A pseudograph is a graph that allows loops as well as multiple edges between the same pair of vertices.
A transport model allowing a route back to its own station can represent that route as a loop.

R

Regular graph
A regular graph is a graph in which every vertex has the same degree, called its regularity degree.
The cube is 3-regular because changing any one of three bits gives three neighbors at each vertex.
Rooted tree
A rooted tree is a tree with a chosen root and edges directed away from it, giving every other vertex one parent.
Rooting a path at its center changes the parent relationships and can reduce its height.

S

Simple graph
A simple graph is an undirected graph with no loops and at most one edge between each pair of distinct vertices.
A mutual friendship model records one connection per pair, so a simple graph is suitable.
Spanning forest
A spanning forest consists of one spanning tree in each connected component and keeps every vertex of the original graph.
A disconnected network can retain connectivity within each component but has no single spanning tree.
Spanning tree
A spanning tree is a subgraph that contains every vertex of its host graph and is itself connected and acyclic.
A tree connecting only four of a graph’s five vertices is not spanning, even if its edge choices are valid.
Sparse graph
A sparse graph has relatively few edges compared with the possible vertex pairs, making neighbor lists compact.
A graph on 500 vertices with only 700 edges stores far fewer neighbor entries than matrix cells.
Strong connectivity
Strong connectivity means that every ordered pair of vertices in a digraph is joined by a directed path.
A directed cycle can be followed from any vertex to any other, continuing around the arrows.
Subdivision
A subdivision of a graph replaces selected edges by paths through new vertices without sharing the paths’ internal vertices.
Inserting a new degree-2 vertex along one edge of K₃,₃ leaves a nonplanar subdivision.

T

Trail
A trail is a walk with no repeated edge, although the same vertex may be visited more than once.
Two triangles sharing a vertex can be traced as one closed trail without repeating any edge.
Traveling salesperson problem
The traveling salesperson problem asks for a Hamilton cycle of minimum total weight in a weighted complete graph.
A least-weight round trip through every town minimizes the total of its selected travel links.
Tree
A tree is a connected undirected graph with no cycles; equivalently, every pair of its vertices has exactly one path between them.
Removing any edge of a tree separates it, because no alternate path links that edge’s endpoints.
Two-coloring
A two-coloring assigns at most two colors to vertices so that adjacent vertices always receive different colors.
Coloring a cycle alternately succeeds for even length but conflicts at the closing edge for odd length.

U

Unique-path property
The unique-path property means that exactly one path joins every pair of vertices, characterizing a tree.
Adding an edge to a tree creates a cycle together with the unique path already joining its endpoints.

V

Vertex
A vertex is an object in a graph’s vertex set, representing one item whose connections the graph records.
In a road model, each town is a vertex, including a town with no candidate road connections.
Vertex connectivity
Vertex connectivity is the fewest vertex deletions that disconnect a graph or leave a single vertex, with 0 for disconnected graphs.
A connected graph with a cut vertex has vertex connectivity 1, regardless of how large its other degrees are.

W

Walk
A walk is a sequence of incident vertices and edges in which vertices and edges may repeat; its length counts edge uses.
Going from A to B, back to A, and then to C is a three-edge walk when those edges exist.
Weak connectivity
Weak connectivity means that a digraph becomes connected when every arrow is treated as an undirected edge.
The arrows A to B and B to C give weak connectivity even though C cannot reach A.
Weighted graph
A weighted graph is a graph that attaches a numerical amount to each edge, such as a length or travel time.
Candidate cables carry weights in kilometers so a spanning tree’s total cable length can be compared.
Wheel graph
A wheel graph adds one hub joined to every vertex of a cycle; here the subscript gives the rim size.
The wheel with a seven-vertex rim has eight vertices altogether and fourteen edges.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started