Maximum number of edges in a 'layered' graph

85 Views Asked by At

What is the maximum number of edges in an $n$-vertex, undirected simple graph whose vertex set has been split into $k$ consecutive layers (or subsets), such that the only edges in the graph go between vertices in layer $i$ and layer $i + 1$ for all $i \in \{1,...,k-1\}$? Basically it's a $k$-partite $n$-vertex graph but each part is labelled with an integer and a vertex with label $i$ can only have edges leading to vertices labelled $i-1$ or $i+1$.

My first thought was $(n^2/k^2)(k-1)$, but after messing around with a few small examples this turned out not to be the case. Any hints would be greatly appreciated.

1

There are 1 best solutions below

2
On BEST ANSWER

The worst case is when two adjacent layers are as large as possible, and the rest are as small as possible.

If you're allowed to have a graph "with $k$ layers" in which actually the last $k-2$ layers have no vertices in them, then you can put $\frac n2$ vertices in the first layer and $\frac n2$ vertices in the second layer. This gives us $(\frac n2)^2 = \frac{n^2}{4}$ edges if all the possible edges exist.

If you have to put at least one vertex in each layer, then you'll have to do that, which will make the number slightly smaller.