This repository has been archived on 2022-06-22. You can view files and clone it, but cannot push or open issues or pull requests.
usaco-guide/content/5_Gold/MST.md
Benjamin Qi 84cc6bcebd + PAPS
2020-06-22 21:00:35 -04:00

38 lines
1.5 KiB
Markdown

---
id: mst
title: "Minimum Spanning Trees"
author: Benjamin Qi
prerequisites:
- Gold - Shortest Paths
- Gold - Disjoint Set Union
description: A subset of the edges of a connected, undirected, edge-weighted graph that connects all the vertices to each other of minimum total weight, where no cycles are allowed.
---
## Standard
- [Kattis Minimum Spanning Tree](https://open.kattis.com/problems/minspantree)
- same as [CSES Road Reparation](https://cses.fi/problemset/task/1675)
## Tutorial
- CPH 15 (Spanning Trees)
- [PAPS 12.4](https://www.csc.kth.se/~jsannemo/slask/main.pdf)
- Prim's Algorithm
- [cp-algo](https://cp-algorithms.com/graph/mst_prim.html)
- Similar to Dijkstra
- Kruskal's Algorithm
- [cp-algo 1](https://cp-algorithms.com/graph/mst_kruskal.html)
- [cp-algo 2](https://cp-algorithms.com/graph/mst_kruskal_with_dsu.html)
## USACO Gold Problems
- [Old Silver - SuperBull](http://www.usaco.org/index.php?page=viewproblem2&cpid=531)
- [Walk](http://usaco.org/index.php?page=viewproblem2&cpid=946)
- Prim's is applicable, but the edge weights are special so you don't actually need to use an MST algo ...
- [Fencedin](http://www.usaco.org/index.php?page=viewproblem2&cpid=623)
- also special ...
## Other Problems
- [Birthday Gifts](https://www.hackerearth.com/practice/math/combinatorics/inclusion-exclusion/practice-problems/algorithm/mancunian-and-birthday-gifts-d44faa15/) [](73)
- [Spanning Tree Fraction](https://www.hackerrank.com/contests/w31/challenges/spanning-tree-fraction) [](78)