Graphs
Learn how to build graphs in Swift.
StartGraphs: Conceptual
Lesson 1 of 2
- 1Graphs are the perfect data structure for modeling networks, which make them an indispensable piece of your data structure toolkit. They’re composed of nodes, or vertices, which hold data, and _…
- 2Graphs have varying degrees of connection. The higher the ratio of edges to vertices, the more connected the graph. This graph represents a social network; people are vertices and edges are friend…
- 3We’re building a graph of favorite neighborhood destinations (vertices) and routes (edges), but not all edges are equal. It takes longer to travel between Gym and Museum than it does to travel bet…
- 4Imagine you’re a superhero escaping a villain’s lair. As you move from perilous room to perilous room, the doors close immediately behind you, barring any return. For this dramatic example, we n…
- 5We typically represent the vertex-edge relationship of a graph in two ways: an adjacency list or an adjacency matrix. An adjacency matrix is a table. Across the top, every vertex in the graph ap…
- 6Graphs are an essential data structure in computer science for modeling networks. Let’s review some key terms: * vertex: A node in a graph. * edge: A connection between two vertices. * adjacent: W…
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory