## Graph Theory Basics

Graph theory is the study of graphs and their properties. A graph is a collection of points, called vertices, and the lines between them, called edges. Graph theory is a branch of mathematics that studies the properties of graphs.

### Define a graph

In mathematics, and more specifically in graph theory, 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) and the relations correspond to abstractions called edges (also called arcs or lines). Typically, a graph is depicted in diagrammatic form as a set of dots for the vertices, joined by lines or curves for the edges. Graphs are one of the prime objects of study in discrete mathematics.

### Define simple, connected, and complete graphs

A graph is simple if it contains no loops (edges from a vertex to itself) or multiple edges between any two vertices. A graph is connected if there exists a path between any two vertices in the graph. A complete graph is a graph where every pair of distinct vertices is connected by an edge.

O(log m) is O(log n) because m <= n. In a simple, connected, complete graph, m = n(n-1)/2, so O(log m) = O(log n).

### Euler’s theorem and its proof

Euler’s theorem states that if a graph is connected and has no odd vertices, then it has an Euler circuit. The proof is simple: since the graph is connected, there is a path between any two vertices. If there are no odd vertices, then the number of edges leaving each vertex must be even, so the path can be extended to form a loop.

## Why olog m is olog n

If we look at a graph with n vertices, we can see that the edges will connect those vertices. We can also see that the edges will have a specific weight or value. The total weight of the edges will be m.

### Define olog

In graph theory, the olog of a graph G is defined as the number of vertices in a minimum vertex cover of G. In other words, it is the smallest number of vertices that can “cover” all the edges of G.

### Prove that olog m is olog n

We will prove this by showing that olog m is a lower bound on olog n.

Consider any algorithm that given a graph G with n vertices and m edges, outputs a connected subgraph H of G such that the number of vertices in H is at most olog m.

We will show that this algorithm cannot exist by giving a graph G for which it outputs a subgraph H with more than olog n vertices.

Let G be the graph consisting of n vertices, each connected to all other vertices by edges. This graph has m = n(n-1)/2 edges.

The algorithm must output a subgraph H with at most olog m vertices. However, since G is already connected, any connected subgraph of G must have at least n/2 vertices (otherwise it would not be connected). Therefore, we have shown that olog m is a lower bound on olog n, and so olog m = olog n.