2020-06-16 17:09:59 +00:00
---
id: intro-graphs
title: Introduction to Graphs
author: Darren Yao, Benjamin Qi
2020-06-26 18:00:32 +00:00
description: "?"
frequency: 2
2020-06-16 17:09:59 +00:00
---
2020-06-24 21:28:57 +00:00
import { Problem } from "../models";
export const metadata = {
problems: {
general: [
2020-06-29 21:03:24 +00:00
new Problem("Silver", "Grass Planting", "894", "Normal", false, ["tree"]),
2020-06-24 21:28:57 +00:00
new Problem("Bronze", "The Great Revegetation", "916", "Hard", false, []),
2020-07-07 01:31:06 +00:00
new Problem("Bronze", "Livestock Lineup", "965", "Hard", false, []),
2020-06-24 21:28:57 +00:00
new Problem("Bronze", "Milk Factory", "940", "Hard", false, ["tree"]),
new Problem("Bronze", "Family Tree", "833", "Hard", false, ["tree"]),
2020-07-06 21:21:40 +00:00
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?)."),
2020-07-07 02:10:02 +00:00
new Problem("Bronze", "Cow Evolution", "941", "Hard", false, [], ""),
2020-06-24 21:28:57 +00:00
]
}
};
2020-06-29 00:32:52 +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 bidirectional roads connecting the cities. Some problems relating to graphs are:
2020-06-26 18:00:32 +00:00
2020-06-29 00:32:52 +00:00
- 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-26 18:00:32 +00:00
2020-06-29 00:32:52 +00:00
- What's the shortest distance I have to travel to get from city $A$ to city $B$?
2020-06-26 18:00:32 +00:00
2020-06-29 00:32:52 +00:00
Both of these tasks will be covered in higher divisions. For now, it suffices to learn how graphs are represented.
2020-06-16 17:09:59 +00:00
2020-06-29 00:32:52 +00:00
<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>
2020-06-16 17:09:59 +00:00
2020-07-07 01:31:06 +00:00
## Problems
2020-06-16 17:09:59 +00:00
2020-07-10 21:56:07 +00:00
(short recap of what you should know for bronze)
2020-06-22 14:26:06 +00:00
2020-06-24 21:28:57 +00:00
<problems-list problems={metadata.problems.general} />