TAOCP Vol 1: Fundamental Algorithms · Week 58

TAOCP 2.3.4 Basic Mathematical Properties of Trees (part 1)

Updated

About 7 hours49 exercises, rated M10 to HM40

Summary

TAOCP 2.3.4 Basic Mathematical Properties of Trees (part 1) covers the first three subsections: free trees (connected graphs without cycles) and spanning trees, including using Kirchhoff's law to count how often each part of a flowchart runs, oriented trees and directed graphs, and more. Budget about 7 hours; do exercises 2.3.4.1-2, 2.3.4.1-10 and 2.3.4.1-6.

Part 1 covers the first three subsections: free trees (connected graphs without cycles) and spanning trees, including using Kirchhoff's law to count how often each part of a flowchart runs; oriented trees and directed graphs, including Euler circuits; and the infinity lemma about infinite trees with finite branching.

Flashcards 14 cards for Anki and AnkiMobile · all decks

Anki deck.tsv

This week's steps

3 steps
  1. Read §2.3.4 Basic Mathematical Properties of Trees (part 1)

    Draw lots of small graphs.

  2. Work the exercises (8 picked)

    Start with Ex 2.3.4.1-2, Ex 2.3.4.1-10, Ex 2.3.4.1-6; log what you solve below.

  3. Write down one thing you'd explain to someone

    A few sentences in your own words in Your notes: the idea, why it works, an example. 30 words ticks this.

Sign in to track this: tick each step off and it counts toward your week.

Exercises

This week has 49 exercises across its subsections, rated M10 to HM40, and Knuth marks 18 of them with the triangle for recommended. Each subsection has its own set, so picks are numbered by subsection: 2.3.4.1 (free trees), 2.3.4.2 (oriented trees) and 2.3.4.3 (the infinity lemma). Many are proofs; pick a few and do them fully.

Worth your time

  • Exercise 2.3.4.1-2M20

    Show any path can be trimmed down to a simple path.

    Discuss

  • Exercise 2.3.4.1-6M27▶ Recommended

    Pick a spanning tree out of an edge list efficiently, or report there is none.

    Discuss

  • Exercise 2.3.4.1-1016

    Connect n terminals with as few wires as possible, and see why a spanning tree is the answer.

    Discuss

  • Exercise 2.3.4.1-1229▶ Recommended

    Turn a minimum spanning tree method into an implementable algorithm with real data structures. The stretch.

    Discuss

  • Exercise 2.3.4.2-4M20▶ Recommended

    Show a directed graph can be topologically sorted exactly when it has no oriented cycles.

    Discuss

  • Exercise 2.3.4.2-7M22▶ Recommended

    Decide whether a condition in the definition of an oriented tree can be dropped.

    Discuss

  • Exercise 2.3.4.2-1022

    Re-root a tree stored as a parent table.

    Discuss

  • Exercise 2.3.4.3-3M23▶ Recommended

    Quadrant tiling versus plane tiling. An infinity lemma workout.

    Discuss

Your log

Sign in to log the exercises you work: number, rating, how far you got.

Your notes

Only you

Sign in to keep private notes on this guide, in Markdown. They stay yours: never on your profile, and you can export them all.

Discussion

0 posts

Questions about the reading go here; each exercise has its own thread below. Hints over answers.

No posts yet. Ask a question or share a tip.

Sign in to postAnyone can read. Posting needs an account with a confirmed email.

Exercise threads

One thread per exercise. Open one to ask for a nudge or check your thinking.

  • Exercise 2.3.4.1-2M20No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 2.3.4.1-6M27No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 2.3.4.1-1016No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 2.3.4.1-1229No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 2.3.4.2-4M20No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 2.3.4.2-7M22No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 2.3.4.2-1022No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 2.3.4.3-3M23No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

Reference

Why it matters

This is the bridge between data-structure trees and graph theory. Spanning trees show up in networking, clustering and circuit design.

Before you start
  • 2.3.1 to 2.3.3
  • 1.2.1 Mathematical Induction
How to approach it

Draw lots of small graphs. Prove to yourself that a tree on n vertices has n - 1 edges. Read 2.3.4.1 to 2.3.4.3 carefully; the infinity lemma is short but subtle.

Common traps
  • Mixing up free trees (no root) and oriented trees (with a root and direction).

Spot a mistake? Report it

Back to week 58