Number Representations & States

"how numbers are stored and used in computers"

Graph Theory

Graph theory is a branch of mathematics that deals with the study of graphs, which are mathematical structures used to represent pairwise relations between objects. It provides a framework for analyzing and solving problems in various fields, including computer science, network analysis, and social sciences.

History

Graph theory has its roots in the 18th century, with the pioneering work of the Swiss mathematician Leonhard Euler. In 1736, Euler solved the famous Königsberg bridge problem, which asked whether it was possible to walk through the city of Königsberg (now Kaliningrad, Russia) and cross each of its seven bridges exactly once. Euler's solution laid the groundwork for graph theory by abstracting the problem into a set of nodes (representing landmasses) and edges (representing bridges), thus creating one of the first instances of a graph.

The field remained relatively dormant until the 19th century when mathematicians such as Gustav Kirchhoff began to apply graph-theoretic concepts to electrical circuits. Kirchhoff's work on circuit laws in 1847 utilized graphs to represent electrical networks, further demonstrating the utility of graph theory in practical applications.

The late 19th and early 20th centuries saw significant advancements in graph theory, particularly with the contributions of mathematicians like Arthur Cayley and George Pólya. Cayley, in the 1850s, used trees (a type of graph) to enumerate chemical compounds, while Pólya developed enumeration techniques that became fundamental in combinatorial chemistry and other fields.

In the 20th century, graph theory expanded rapidly, driven by its applications in computer science, operations research, and social network analysis. The development of algorithms for graph traversal, such as Dijkstra's algorithm for shortest paths and Kruskal's algorithm for minimum spanning trees, highlighted the importance of graph theory in solving complex computational problems.

Shortest path

The shortest path problem is a fundamental problem in graph theory that seeks to find the shortest path between two nodes in a graph. It has applications in various fields, including transportation, telecommunications, and computer networks.

Algorithm Efficiency

Shortest Path Algorithms

  1. Dijkstra's Algorithm

    • Time Complexity: , where is the number of vertices and is the number of edges. This complexity arises from using a priority queue to select the next closest vertex.
    • Space Complexity: , primarily due to the storage of the distance array and the priority queue.
  2. Bellman-Ford Algorithm

    • Time Complexity: , as it relaxes all edges times.
    • Space Complexity: , for storing the distance array.
  3. Floyd-Warshall Algorithm

    • Time Complexity: , because it considers all pairs of vertices and updates the shortest paths.
    • Space Complexity: , due to the storage of the distance matrix.
  4. A Algorithm*

    • Time Complexity: in the worst case, but typically better with a good heuristic.
    • Space Complexity: , for storing the open and closed sets.
  5. Johnson's Algorithm

    • Time Complexity: , combining Dijkstra's algorithm for each vertex and reweighting edges.
    • Space Complexity: , for storing the distance matrix.

Minimum spanning tree

The minimum spanning tree problem is a classic problem in graph theory that seeks to find a spanning tree of a graph with the smallest possible total edge weight. It has applications in various fields, including transportation, telecommunications, and computer networks.

  1. Kruskal's Algorithm

    • Time Complexity: , primarily due to sorting the edges.
    • Space Complexity: , for the disjoint set data structure.
  2. Prim's Algorithm

    • Time Complexity: , similar to Dijkstra's algorithm when using a priority queue.
    • Space Complexity: , for storing the minimum spanning tree and the priority queue.
  3. Borůvka's Algorithm

    • Time Complexity: , as it repeatedly connects components using minimum weight edges.

Maximum flow

The maximum flow problem is a fundamental problem in graph theory that seeks to find the maximum amount of flow that can be sent from a source node to a sink node in a network. It has applications in various fields, including transportation, telecommunications, and computer networks.

  1. Ford-Fulkerson Algorithm

    • Time Complexity: , where the complexity depends on the maximum flow value.
    • Space Complexity: , for storing the residual graph.
  2. Dinic's Algorithm

    • Time Complexity: , due to the layered network and blocking flow approach.
    • Space Complexity: , for storing the level graph and the residual graph.
  3. Edmonds-Karp Algorithm

    • Time Complexity: , as it is a specific implementation of the Ford-Fulkerson method using BFS.
    • Space Complexity: , for storing the residual graph.

Minimum cut

The minimum cut problem is a fundamental problem in graph theory that seeks to find the minimum cut of a graph. It has applications in various fields, including transportation, telecommunications, and computer networks.

Maximum matching

The maximum matching problem is a fundamental problem in graph theory that seeks to find the maximum matching of a graph. It has applications in various fields, including transportation, telecommunications, and computer networks.

Maximum independent set

The maximum independent set problem is a fundamental problem in graph theory that seeks to find the maximum independent set of a graph. It has applications in various fields, including transportation, telecommunications, and computer networks.

Maximum clique

The maximum clique problem is a fundamental problem in graph theory that seeks to find the maximum clique of a graph. It has applications in various fields, including transportation, telecommunications, and computer networks.

Minimum vertex cover

The minimum vertex cover problem is a fundamental problem in graph theory that seeks to find the minimum vertex cover of a graph. It has applications in various fields, including transportation, telecommunications, and computer networks.

Maximum weighted independent set

The maximum weighted independent set problem is a fundamental problem in graph theory that seeks to find the maximum weighted independent set of a graph. It has applications in various fields, including transportation, telecommunications, and computer networks.

Maximum weighted clique

The maximum weighted clique problem is a fundamental problem in graph theory that seeks to find the maximum weighted clique of a graph. It has applications in various fields, including transportation, telecommunications, and computer networks.

Graph Coloring

The graph coloring problem is a classic problem in graph theory that involves assigning colors to the vertices of a graph such that no two adjacent vertices share the same color. This problem has applications in scheduling, register allocation in compilers, and frequency assignment in wireless networks.

Traveling Salesman Problem

The traveling salesman problem (TSP) is a well-known problem in graph theory and combinatorial optimization. It seeks to find the shortest possible route that visits each city exactly once and returns to the origin city. TSP has applications in logistics, planning, and the manufacturing of microchips.

Graph Isomorphism

The graph isomorphism problem involves determining whether two graphs are isomorphic, meaning there is a one-to-one correspondence between their vertex sets that preserves adjacency. This problem is significant in chemistry for comparing molecular structures and in computer science for pattern recognition.

Bipartite Graphs

A bipartite graph is a type of graph whose vertices can be divided into two disjoint sets such that no two graph vertices within the same set are adjacent. Bipartite graphs are used in modeling relationships in social networks, matching problems, and network flow problems.

Planar Graphs

A planar graph can be drawn on a plane without any edges crossing. Planar graphs are important in geography for map coloring and in circuit design for minimizing wire crossings.

Eulerian and Hamiltonian Paths

An Eulerian path in a graph visits every edge exactly once, while a Hamiltonian path visits every vertex exactly once. These concepts are used in solving puzzles, designing circuits, and optimizing routes.

Network Flow

Network flow problems involve finding the optimal way to send flow through a network from a source to a sink. These problems are crucial in optimizing transportation systems, telecommunications, and supply chain logistics.