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_Bronze/Intro_Graphs.mdx
Benjamin Qi 569b14ff01 freqs
2020-06-26 14:00:32 -04:00

56 lines
No EOL
2.2 KiB
Text

---
id: intro-graphs
title: Introduction to Graphs
author: Darren Yao, Benjamin Qi
description: "?"
frequency: 2
---
import { Problem } from "../models";
export const metadata = {
problems: {
general: [
new Problem("Silver", "Grass Planting", "894", "Easy", false, ["tree"]),
new Problem("Bronze", "The Great Revegetation", "916", "Hard", false, []),
new Problem("Bronze", "Milk Factory", "940", "Hard", false, ["tree"]),
new Problem("Bronze", "Swapity Swap", "1013", "Hard", false, ["permutation"], "Hint: One option is to keep swapping until the permutation returns to its original state (but can you do better?)."),
new Problem("Bronze", "Family Tree", "833", "Hard", false, ["tree"]),
]
}
};
<info-block title="Pro Tip">
Very important at the Silver level and above, not very frequent in bronze.
</info-block>
Graphs can be used to represent many things, from images to wireless signals, but one of the simplest analogies is to a map. Consider a map with several cities and highways connecting the cities. Some problems relating to graphsare:
- If we have a map with some cities and roads, what's the shortest distance I have to travel to get from point A to point B?
- Consider a map of cities and roads. Is city A connected to city B? Consider a region to be a group of cities such that each city in the group can reach any other city in said group, but no other cities. How many regions are in this map, and which cities are in which region?
Both of these will be covered in Silver. For now, it suffices to learn how graphs are represented.
## Tutorial
- Recommended
- CPH 11 (Basics of graphs)
- Intro to USACO 10.1 - 10.3
- [PAPS 6.4](https://www.csc.kth.se/~jsannemo/slask/main.pdf)
- [CSAcademy Graph Intro](https://csacademy.com/lesson/introduction_to_graphs)
- [CSAcademy Graph Representations](https://csacademy.com/lesson/graph_representation)
- Usually, adjacency lists are used.
- Other
- [Topcoder Graphs Pt 1](https://www.topcoder.com/community/data-science/data-science-tutorials/introduction-to-graphs-and-their-data-structures-section-1/)
## Trees?
## USACO Bronze Problems
(what are you expected to know?)
(add some more)
<problems-list problems={metadata.problems.general} />