A graph is a collection of nodes connected by edges. It can be represented using an adjacency matrix or adjacency lists. The adjacency matrix stores whether each possible edge exists in an n×n matrix, while adjacency lists only store the existing edges to save space for sparse graphs. Dijkstra's algorithm finds the shortest path from a source node to all other nodes in a graph by maintaining a set of processed nodes and updating the distance to unprocessed nodes through neighboring processed nodes.