Global web icon
princeton.edu
https://algs4.cs.princeton.edu/42digraph/
Directed Graphs - Princeton University
A directed graph (or digraph) is a set of vertices and a collection of directed edges that each connects an ordered pair of vertices. We say that a directed edge points from the first vertex in the pair and points to the second vertex in the pair.
Global web icon
princeton.edu
https://algs4.cs.princeton.edu/lectures/keynote/42…
Directed Graphs - Princeton University
4.2 DIRECTED GRAPHS ‣ introduction ‣ digraph API ‣ digraph search ‣ topological sort ‣ strong components
Global web icon
princeton.edu
https://algs4.cs.princeton.edu/44sp/
Shortest Paths - Princeton University
Given a weighted line-graph (undirected connected graph, all vertices of degree 2, except two endpoints which have degree 1), devise an algorithm that preprocesses the graph in linear time and can return the distance of the shortest path between any two vertices in constant time.
Global web icon
princeton.edu
https://algs4.cs.princeton.edu/41graph/
Undirected Graphs - Princeton University
Given a connected graph, design a linear-time algorithm to find a vertex whose removal (deleting the vertex and all incident edges) does not disconnect the graph.
Global web icon
princeton.edu
https://algs4.cs.princeton.edu/40graphs/
4. Graphs - Princeton University
4.1 Undirected Graphs introduces the graph data type, including depth-first search and breadth-first search. 4.2 Directed Graphs introduces the digraph data type, including topological sort and strong components.
Global web icon
princeton.edu
https://algs4.cs.princeton.edu/64maxflow/
6.4 Maximum Flow - Princeton University
Given an undirected graph and two vertices s and t, find a simple cycle containing both s and t (or report that no such cycle exists). Hint: there is a directed cycle containing both s and t if and only if there are two (internally) vertex-disjoint paths between s and t.
Global web icon
princeton.edu
https://algs4.cs.princeton.edu/43mst/
Minimum Spanning Trees - Princeton University
If a graph is not connected, we can adapt our algorithms to compute the MSTs of each of its connected components, collectively known as a minimum spanning forest.
Global web icon
princeton.edu
https://algs4.cs.princeton.edu/42digraph/Digraph.j…
Digraph.java - Princeton University
Below is the syntax highlighted version of Digraph.java from §4.2 Directed Graphs.
Global web icon
princeton.edu
https://algs4.cs.princeton.edu/15uf/
Case Study: Union-Find - Princeton University
Physicists refer to it as the Hoshen–Kopelman algorithm although it is simply union–find on a grid graph with raster-scan order. Applications include modeling percolation and electrical conductance.
Global web icon
princeton.edu
https://algs4.cs.princeton.edu/32bst/
Binary Search Trees - Princeton University
3.2 Binary Search Trees We examine a symbol-table implementation that combines the flexibility of insertion in linked lists with the efficiency of search in an ordered array. Specifically, using two links per node leads to an efficient symbol-table implementation based on the binary search tree data structure, which qualifies as one of the most fundamental algorithms in computer science ...