Maximum number of edges in a bipartite graph: why ⌊n2/4⌋\lfloor n^2/4\rfloor is optimal

Maximum number of edges in a bipartite graph: why ⌊n2/4⌋\lfloor n^2/4\rfloor is optimal

Verified Sources
Sep 12, 2026

In an (undirected, simple) bipartite graph G=(U∪W,E)G=(U\cup W,E), every edge joins a vertex in UU to a vertex in WW. Suppose ∣U∣=a|U|=a, ∣W∣=b|W|=b and a+b=na+b=n. Then the maximum possible number of edges is achieved by the complete bipartite graph Ka,bK_{a,b}, which has abab edges, so ∣E∣≤ab|E|\le ab. The product abab is maximized (for fixed a+b=na+b=n) when the parts are as equal as possible, giving the sharp bound ∣E∣≤⌊n24⌋.|E|\le \left\lfloor\frac{n^2}{4}\right\rfloor. This implies the multiple-choice answer is (ii) n2/4n^2/4 (and more precisely, ≤⌊n2/4⌋\le\lfloor n^2/4\rfloor; equality when the bipartition sizes are ⌊n/2⌋,⌈n/2⌉\lfloor n/2\rfloor,\lceil n/2\rceil). The extremal graph is K⌊n/2⌋,⌈n/2⌉K_{\lfloor n/2\rfloor,\lceil n/2\rceil}. 3

Key terms: bipartite graph , complete bipartite graph , partite sets , extremal graph.

Footnotes

  1. Maximum edges of a bipartite graph - States the sharp bound lfloorn2/4rfloor\\lfloor n^2/4\\rfloor and discusses equality cases. ↩

  2. How would one find the maximum number of edges in a bipartite graph with n vertices? - Quora - Gives lfloorn2/4rfloor\\lfloor n^2/4\\rfloor achieved by Klfloorn/2rfloor,lceiln/2rceilK_{\\lfloor n/2\\rfloor,\\lceil n/2\\rceil}. ↩

  3. Complete bipartite graph - Wikipedia - Background on complete bipartite graphs and their role as extremal constructions (context for Ka,bK_{a,b}). ↩

Maximum number of edges in a simple bipartite graph is n^2/4

Step (i) why ∣E∣≤n24|E|\le \dfrac{n^2}{4} holds

Let GG be bipartite with parts UU and WW, ∣U∣=a|U|=a, ∣W∣=b|W|=b, a+b=na+b=n. Each vertex in UU can connect to at most all bb vertices of WW, so the total number of edges satisfies ∣E∣≤a⋅b.|E| \le a\cdot b. Thus we reduce the problem to maximizing the product abab subject to a+b=na+b=n.

A standard algebra step gives ab=a(n−a)=−(a−n2)2+n24≤n24.ab=a(n-a)= -\left(a-\frac n2\right)^2+\frac{n^2}{4}\le \frac{n^2}{4}. So always ∣E∣≤n2/4|E|\le n^2/4. When nn is even, taking a=b=n/2a=b=n/2 gives equality ∣E∣=n2/4|E|=n^2/4 via Kn/2,n/2K_{n/2,n/2}. When nn is odd, the maximum becomes ⌊n2/4⌋\lfloor n^2/4\rfloor, still bounded by n2/4n^2/4. 3

Key terms: simple graph , edge count , inequality.

Footnotes

  1. Maximum edges of a bipartite graph - States the sharp bound lfloorn2/4rfloor\\lfloor n^2/4\\rfloor and discusses equality cases. ↩

  2. How would one find the maximum number of edges in a bipartite graph with n vertices? - Quora - Gives lfloorn2/4rfloor\\lfloor n^2/4\\rfloor achieved by Klfloorn/2rfloor,lceiln/2rceilK_{\\lfloor n/2\\rfloor,\\lceil n/2\\rceil}. ↩

  3. Complete bipartite graph - Wikipedia - Background on complete bipartite graphs and their role as extremal constructions (context for Ka,bK_{a,b}). ↩

Compute the sharp maximum: $|E| \le \lfloor n^2/4\rfloor$

  1. 1
    Step 1

    Write the bipartite graph as U∪WU\cup W with ∣U∣=a|U|=a, ∣W∣=b|W|=b, so a+b=na+b=n.

  2. 2
    Step 2

    Since every edge must go across the cut, at most all abab cross-pairs can be edges, so ∣E∣≤ab|E|\le ab.

  3. 3
    Step 3

    Use ab=a(n−a)=−(a−n2)2+n24≤n24ab=a(n-a)= -\left(a-\frac n2\right)^2+\frac{n^2}{4}\le \frac{n^2}{4}.

  4. 4
    Step 4

    If nn is odd, the integer maximizer gives ∣E∣≤⌊n24⌋|E|\le \left\lfloor\frac{n^2}{4}\right\rfloor, achieved by K⌊n/2⌋,⌈n/2⌉K_{\lfloor n/2\rfloor,\lceil n/2\rceil}.

  5. 5
    Step 5

    The bound matches choice (ii) n2/4n^2/4 (with the sharper form ⌊n2/4⌋\lfloor n^2/4\rfloor).

Pro Tip

"When a question asks for the maximum number of edges in a bipartite graph with nn vertices, immediately consider the extremal candidate Ka,bK_{a,b} and maximize abab with a+b=na+b=n." 2

Footnotes

  1. Maximum edges of a bipartite graph - States the sharp bound lfloorn2/4rfloor\\lfloor n^2/4\\rfloor and discusses equality cases. ↩

  2. Complete bipartite graph - Wikipedia - Background on complete bipartite graphs and their role as extremal constructions (context for Ka,bK_{a,b}). ↩

Common pitfall: ignoring the rounding

"If nn is odd, the exact maximum is ⌊n2/4⌋\lfloor n^2/4\rfloor, not n2/4n^2/4. Many multiple-choice tests accept n2/4n^2/4 as an upper bound even though equality may fail." 2

Footnotes

  1. Maximum edges of a bipartite graph - States the sharp bound lfloorn2/4rfloor\\lfloor n^2/4\\rfloor and discusses equality cases. ↩

  2. How would one find the maximum number of edges in a bipartite graph with n vertices? - Quora - Gives lfloorn2/4rfloor\\lfloor n^2/4\\rfloor achieved by Klfloorn/2rfloor,lceiln/2rceilK_{\\lfloor n/2\\rfloor,\\lceil n/2\\rceil}. ↩

Maximum edges for small nn (using ⌊n2/4⌋\lfloor n^2/4\rfloor)

Extremal bipartite graph: K⌊n/2⌋,⌈n/2⌉K_{\lfloor n/2\rfloor,\lceil n/2\rceil}

Why is $K_{a,b}$ extremal?

Knowledge Check

Question 1 of 3
Q1Single choice

A bipartite graph on nn vertices has at most how many edges?