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.md

47 lines
2.2 KiB
Markdown
Raw Normal View History

2020-06-16 17:09:59 +00:00
---
id: intro-graphs
title: Introduction to Graphs
author: Darren Yao, Benjamin Qi
2020-06-22 17:56:41 +00:00
description: "Graph theory is one of the most important topics at the Silver level and above, although some basic problems occasionally appear in Bronze."
2020-06-16 17:09:59 +00:00
---
2020-06-16 18:05:15 +00:00
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:
2020-06-16 17:09:59 +00:00
- 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?
2020-06-16 18:05:15 +00:00
Both of these will be covered in Silver. For now, it suffices to learn how graphs are represented.
2020-06-16 17:09:59 +00:00
## Tutorial
- Recommended
2020-06-23 01:00:35 +00:00
- CPH 11 (Basics of graphs)
2020-06-16 17:09:59 +00:00
- Intro to USACO 10.1 - 10.3
2020-06-23 01:00:35 +00:00
- [PAPS 6.4](https://www.csc.kth.se/~jsannemo/slask/main.pdf)
2020-06-16 17:09:59 +00:00
- [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/)
2020-06-16 18:05:15 +00:00
## Trees?
2020-06-16 17:09:59 +00:00
## USACO Bronze Problems
2020-06-24 20:50:30 +00:00
(what are you expected to know?)
2020-06-22 14:26:06 +00:00
2020-06-16 17:09:59 +00:00
(add some more)
2020-06-24 20:50:30 +00:00
<problems-list>
<problem name="Silver - Grass Planting" usaco="894" difficulty="Easy" tags={["tree"]}>
</problem>
<problem name="The Great Revegetation" usaco="916" difficulty="Hard" tags={[]}>
</problem>
<problem name="Factory" usaco="940" difficulty="Hard" tags={["tree"]}>
</problem>
<problem name="Swapity Swap" usaco="1013" difficulty="Hard" tags={["permutation"]}>
Hint: One option is to keep swapping until the permutation returns to its original state (but can you do better?).
</problem>
<problem name="Family Tree" usaco="833" difficulty="Hard" tags={["tree"]}>
</problem>
</problems-list>