
4.1 Undirected Graphs - Princeton University
Apr 16, 2019 · Undirected graph data type. We implement the following undirected graph API. The key method adj() allows client code to iterate through the vertices adjacent to a given vertex.
4.2 Directed Graphs - Princeton University
Jan 14, 2020 · A mixed graph is a graph with some edges that are directed and others that are undirected. Design a linear-time algorithm to determine whether it is possible to orient the undirected edges so that the resulting digraph has a directed cycle.
4. Graphs - Princeton University
Aug 26, 2016 · We progress through the four most important types of graph models: undirected graphs (with simple connections), digraphs graphs (where the direction of each connection is significant), edge-weighted graphs (where each connection has an software associated weight), and edge-weighted digraphs (where each connection has both a direction and a weight).
4.4 Shortest Paths - Princeton University
Jan 10, 2025 · Shortest paths in undirected graphs. Write a program DijkstraUndirectedSP.java that solves the single-source shortest paths problems in undirected graphs with nonnegative weights using Dijkstra's algorithm.
4.3 Minimum Spanning Trees - Princeton University
Jan 10, 2025 · A minimum spanning tree (MST) of an edge-weighted graph is a spanning tree whose weight (the sum of the weights of its edges) is no larger than the weight of any other spanning tree. Assumptions. To streamline the presentation, we adopt the following conventions: The graph is connected.
6.4 Maximum Flow - Princeton University
Jun 14, 2017 · Vertex disjoint paths in an undirected graph. Given an undirected graph G and two vertices s and t, find the maximum number of of vertex-disjoint paths between s and t. Hint : Replace each undirected edge v-w by two directed edges v->w and w->v.
Graph.java - Princeton University
Jan 6, 2025 · NoSuchElementException; /** * The {@code Graph} class represents an undirected graph of vertices * named 0 through <em> V </em> – 1. * It supports the following two primary operations: add an edge to the graph, * iterate over all of the vertices adjacent to a vertex.
Lecture Slides - Princeton University
Mar 13, 2024 · Lecture 12: Undirected Graphs. We define an undirected graph API and consider the adjacency-matrix and adjacency-lists representations. We introduce two classic algorithms for searching a graph—depth-first search and breadth-first search.
Algorithms and Data Structures Cheatsheet - Princeton University
Feb 3, 2023 · Algorithms and Data Structures Cheatsheet. We summarize the performance characteristics of classic algorithms and data structures for sorting, priority queues, symbol tables, and graph processing.
2.4 Priority Queues - Princeton University
Apr 24, 2022 · The basic data structures that we discussed in Section 1.3 provide us with four immediate starting points for implementing priority queues. Array representation (unordered). Perhaps the simplest priority queue implementation is based on our code for pushdown stacks.