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/3_Gold/4_Gold_TopoSort.md

33 lines
1.1 KiB
Markdown
Raw Normal View History

2020-06-04 01:42:57 +00:00
---
slug: /gold/topological-sort
2020-06-04 05:39:49 +00:00
title: "Topological Sort"
2020-06-04 03:26:53 +00:00
author: Benjamin Qi
2020-06-04 05:39:49 +00:00
order: 4
2020-06-04 01:42:57 +00:00
---
2020-06-04 21:42:30 +00:00
Assumes familiarity with "Silver - Depth First Search."
2020-06-04 14:28:47 +00:00
A [topological sort](https://en.wikipedia.org/wiki/Topological_sorting) of a directed graph is a linear ordering of its vertices such that for every directed edge $u\to v$ from vertex $u$ to vertex $v$, $u$ comes before $v$ in the ordering.
2020-06-04 05:39:49 +00:00
2020-06-04 14:28:47 +00:00
<!-- END DESCRIPTION -->
2020-06-04 13:54:18 +00:00
2020-06-04 14:28:47 +00:00
## Example Problems
2020-06-03 20:56:04 +00:00
2020-06-03 21:08:42 +00:00
- [CSES Course Schedule](https://cses.fi/problemset/task/1679)
- [CSES Longest Flight Route](https://cses.fi/problemset/task/1680)
- [CSES Game Routes](https://cses.fi/problemset/task/1681)
2020-06-04 13:54:18 +00:00
## Tutorial
2020-06-03 20:56:04 +00:00
- CPH 16.1, 16.2
- [cp-algorithms](https://cp-algorithms.com/graph/topological-sort.html)
2020-06-04 14:28:47 +00:00
-
2020-06-03 20:56:04 +00:00
2020-06-04 13:54:18 +00:00
## Problems
2020-06-03 20:56:04 +00:00
2020-06-04 13:54:18 +00:00
- USACO Gold
- [Timeline](http://www.usaco.org/index.php?page=viewproblem2&cpid=1017)
- [Milking Order](http://www.usaco.org/index.php?page=viewproblem2&cpid=838)
- Other
- [Minimal Labels](http://codeforces.com/contest/825/problem/E) [](53)
- [Quantum](https://open.kattis.com/contests/acpc17open/problems/quantumsuperposition) [](84)