| Use every edge exactly onceEuler path · step by step | Visit every node exactly onceHamiltonian path | Degrees, plus one connectivity check, settle Euler. Whether a partial Hamiltonian path can still be finished depends on the whole set of nodes it has used. |
| Connect every city as cheaply as possibleminimum spanning tree · step by step | Visit every city and come back, as cheaply as possibletraveling salesman | Choosing edges versus choosing an order. The cut property lets greedy commit to an edge; nothing lets you commit to one leg of a tour. |
| Connect every cityminimum spanning tree | Connect only the marked cities, through any of the othersSteiner tree | Which unmarked cities to route through is a subset choice. |
| Color the nodes with 2 colors so no edge joins two of the samebipartite check · BFS | The same with 3 colors3-coloring | With two colors every choice is forced by a neighbor. With three, choices stay open and interact across the graph. |
| Shortest path between two nodes, no negative cyclesDijkstra, Bellman–Ford | Longest path that repeats no nodelongest simple path | A shortest path never wants to revisit a node, so “no repeats” comes free. A longest one always would, so it becomes a global constraint. |
| Longest path in a graph with no cyclesDAG · topological order + DP | Longest path in a graph with cycleslongest simple path | The topological order gives the DP an order to fill in. Cycles take it away. |
| Pair workers with jobs they can do, as many pairs as possiblebipartite matching | Group workers, jobs and machines into compatible triples3-dimensional matching | An augmenting path improves a matching one pair at a time. Triples have no such move. |
| Fewest edges that touch every nodeedge cover | Fewest nodes that touch every edgevertex cover | Edge cover = n − maximum matching. Vertex cover has no such formula, except in bipartite graphs, where König's theorem makes it a matching too. |
| Most intervals with no two overlappinginterval scheduling | Most nodes with no edge between any twomaximum independent set | On a line, the interval that ends first is always a safe pick. A general graph has no such order. |
| Fewest rooms for a set of meetingscoloring intervals | Fewest colors for any graphchromatic number | For intervals the answer is the largest overlap at a single moment, found by one sweep. |
| Split an array into two contiguous parts with equal sumsprefix sums | Split it into two subsets with equal sumspartition | Contiguous: n − 1 places to cut. Subsets: 2n ways to choose. |
| Fill a bag when items can be cut into piecesfractional knapsack | Fill a bag with whole items0/1 knapsack | Cutting lets greedy go by value per weight. Whole items need a DP over capacity, which is only pseudo-polynomial. |
| Unit-time jobs with deadlines and profits, most profitgreedy + union-find | Jobs of any length with deadlines and weights, least weight lateweighted late jobs | Equal lengths make jobs interchangeable, so greedy by profit is safe (a matroid). Different lengths turn it into knapsack. |
| Satisfy clauses of two literals each, like (a or not b)2-SAT | Satisfy clauses of three literals each3-SAT | A two-literal clause is two implications; strongly connected components of the implication graph decide it. |
| Drive down every street, as short as possibleChinese postman | Stop at every house, as short as possibletraveling salesman | Streets are edges again: Euler's degree test, plus a matching that pairs up the odd-degree corners. |
| Optimize a linear objective over real numberslinear programming | The same, with whole numbers onlyinteger linear programming | Real solutions form one convex region, where a local optimum is global. Requiring integers breaks it into separate points. |