Graphs

Home > Computer Science > Algorithms and data structures > Graphs

A collection of vertices (nodes) and edges (connections) between them. Graphs can be used for a variety of applications ranging from social networking to route planning.

Graph representation: Different ways to represent a graph such as adjacency matrix, adjacency list, incidence matrix, and edge list. Each has its advantages and disadvantages.
Graph traversal: Algorithms that visit all the vertices and edges of a graph in a systematic way. Breadth First Search (BFS) and Depth First Search (DFS) are some of the popular ones.
Shortest path algorithms: Algorithms that find the shortest path between two vertices. Dijkstra's algorithm and Bellman-Ford algorithm are some of the commonly used ones.
Minimum spanning tree algorithms: Algorithms that find the minimum cost tree that connects all vertices. Kruskal's algorithm and Prim's algorithm are some of the popular ones.
Topological sorting: A linear ordering of the vertices of a graph such that for every directed edge, the source vertex comes before the target vertex. Useful in scheduling and task ordering problems.
Strongly connected components: A subset of vertices in a directed graph such that any two vertices in the subset can reach each other. Algorithms like Tarjan's algorithm and Kosaraju's algorithm are used to find strongly connected components.
Maximum flow and minimum cut algorithms: Algorithms that find the maximum flow that can be sent through a network and the minimum cut that separates the source and sink vertices.
Graph coloring: Assigning colors to the vertices of a graph such that no two adjacent vertices have the same color. Useful in scheduling and mapping problems.
Graph matching: Finding a subset of edges in a graph such that no two edges share a vertex. Useful in scheduling and assignment problems.
Centrality measures: Metrics to identify the most important vertices in a graph, such as degree centrality, betweenness centrality, and eigenvector centrality. Useful in network analysis and social network analysis.
Graph partitioning: Dividing a graph into smaller subgraphs while minimizing the number of edges between them. Useful in distributed computing and data mining.
Graph theory basics: The fundamental concepts of graph theory, such as cycles, paths, connectivity, and planarity. These are important to understand before diving into more complex algorithms and data structures.
Graph algorithms analysis: Understanding the time and space complexity of each algorithm and choosing the most appropriate one for the problem at hand.
Directed Graphs: Also known as Digraph, it is a graph where each edge has a direction, which means the connection between two vertices is unidirectional.
Undirected Graphs: In this type, the edges do not have any particular direction. So, the connections between the vertices are bi-directional.
Weighted Graphs: These are the graphs where the edges have weights, which can be an integer or floating-point number.
Unweighted Graphs: In contrast to weighted graphs, these are graphs where the edges do not have any weights or classifications.
Cyclic Graphs: These are graphs containing at least one cycle, which means it has a path starting and ending at one vertex.
Acyclic Graphs: These are the opposite of cyclic graphs, and they do not contain any cycles. In other words, acyclic graphs are DAGs (Directed Acyclic Graphs).
Complete Graphs: These have a vertex for every pair of vertices and are in a completely connected state.
Biconnected Graphs: These are graphs that are still connected even when any vertex (or edge) is removed.
Bipartite Graphs: These are graphs whose vertices can be divided into two groups, such that no two vertices within the same group are adjacent.
Trees: Trees are graphs that do not contain any cycles, and every pair of vertices is connected by a single unique.
Planar Graphs: These are graphs that can be drawn on a plane without any edges crossing or intersecting.
Spanning Trees: These are trees formed by connecting all vertices of an undirected graph without forming any cycles.
Eulerian Graphs: These are graphs that contain an Eulerian path, which is a path that visits every edge of the graph at least once.
Hamiltonian Graphs: These are graphs that contain a Hamiltonian path, which is a path that visits every vertex of the graph exactly once.
"A graph is a structure amounting to a set of objects in which some pairs of the objects are in some sense 'related'."
"The objects correspond to mathematical abstractions called vertices (also called nodes or points)."
"Each of the related pairs of vertices is called an edge (also called a link or line)."
"Typically, a graph is depicted in diagrammatic form as a set of dots or circles for the vertices, joined by lines or curves for the edges."
"Graphs are one of the objects of study in discrete mathematics."
"The edges may be directed or undirected."
"If the vertices represent people at a party, and there is an edge between two people if they shake hands, then this graph is undirected."
"Any person A can shake hands with a person B only if B also shakes hands with A."
"If an edge from a person A to a person B means that A owes money to B, then this graph is directed."
"Owing money is not necessarily reciprocated."
"The word 'graph' was first used in this sense by J. J. Sylvester in 1878."
"Due to a direct relation between mathematics and chemical structure (what he called a chemico-graphical image)."
"The edges may be directed or undirected."
"The objects correspond to mathematical abstractions called vertices (also called nodes or points)."
"Each of the related pairs of vertices is called an edge (also called a link or line)."
"Typically, a graph is depicted in diagrammatic form as a set of dots or circles for the vertices, joined by lines or curves for the edges."
"Graphs are one of the objects of study in discrete mathematics."
"The nature of the relationship between the objects determines whether the edges are directed or undirected."
"A directed graph is one where the edges have a specific direction, indicating a relationship or flow from one object to another."
"An undirected graph is one where the edges do not have a specific direction and represent a symmetric relationship between objects (such as shaking hands)."