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/2_Bronze/Intro_Graphs.mdx

46 lines
2.4 KiB
Text

---
id: intro-graphs
title: Introduction to Graphs
author: Darren Yao, Benjamin Qi
description: "Visualizing problems as graphs with resources covering basic terminology."
frequency: 2
---
import { Problem } from "../models";
export const problems = {
general: [
new Problem("Silver", "Grass Planting", "894", "Normal", false, ["tree"]),
new Problem("Bronze", "The Great Revegetation", "916", "Hard", false, []),
new Problem("Bronze", "Livestock Lineup", "965", "Hard", false, []),
new Problem("Bronze", "Milk Factory", "940", "Hard", false, ["tree"]),
new Problem("Bronze", "Family Tree", "833", "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", "Cow Evolution", "941", "Hard", false, [], ""),
]
};
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 bidirectional roads connecting the cities. Some problems relating to graphs are:
- 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?
- What's the shortest distance I have to travel to get from city $A$ to city $B$?
Both of these tasks will be covered in higher divisions. For now, it suffices to learn how graphs are represented.
<Resources>
<Resource source="CSA" title="Introduction to Graphs" url="introduction_to_graphs" starred>interactive</Resource>
<Resource source="CSA" title="Graph Representations" url="graph_representation" starred>interactive - adjacency lists and matrices</Resource>
<Resource source="CPH" title="11 - Basics of Graphs" starred>graph terminology, representation</Resource>
<Resource source="IUSACO" title="10.1 to 10.3 - Graph Theory" starred>graph basics and representation, trees</Resource>
<Resource source="PAPS" title="6.4 - Graphs">adjacency matrices, lists, maps</Resource>
<Resource source="TC" title="Intro to Graphs Section 1" url="introduction-to-graphs-and-their-data-structures-section-1"></Resource>
</Resources>
## What Should You Know for Bronze?
<IncompleteSection />
## Problems
<Problems problems={problems.general} />