Graph

From Progteam

This page discusses the subject of graphs. For a list of problems related to graphs, see Category:Graph.

A graph is a set of objects called points, nodes, or vertices connected by links called lines or edges. In a proper graph, which is by default undirected, a line from point A to point B is considered to be the same thing as a line from point B to point A. In a digraph, short for directed graph, the two directions are counted as being distinct arcs or directed edges. Typically, a graph is depicted in diagrammatic form as a set of dots (for the points, vertices, or nodes), joined by curves (for the lines or edges)

Code Packet

Modeling problems as graphs is essential for contest problems. The implementation of a graph, and some graph algorithms appear below:

NOTE: This class requires a List implementation, which also appears in the code packet.