 Previously, we found that a 3-partite graph with 7 vertices could have up to 16 edges if the partite sets had 3, 2, and 2 vertices, with edges joining every vertex in any partite set to every vertex in the other partite sets. We designate these as complete partite graphs and use the notation k3222 to describe them. The important question, how should we distribute v vertices among k partite sets so that our complete partite graph has as many edges as possible? Based on one example, we can conclude, well, nothing really. But if we look at other examples, with 10 vertices, the split 433 could allow up to 33 edges. With 15 vertices, the split 555 could allow up to 75 edges, and with 20 vertices, the split 766 could allow up to 120 edges. So it appears that splitting the vertices into sets that are nearly equal will allow for the greatest number of edges. Let's prove it. So first, how can we make the set very nearly equal? With v vertices, we begin by putting the floor of v divided by k vertices in each set. In other words, we divide v by k and round down. This leaves some number r of vertices unassigned, so we'll add one of the unassigned vertices to each of our sets. So every set will either have floor v over k or floor v over k plus 1 elements. Suppose we've partitioned our vertices into sets with v1, v2, and so on vertices, where we'll assume we have a non-decreasing ordering of our vertices. Then the maximum number of edges will be our sum of the products. And if the sets are very nearly equal, then the absolute difference between the numbers of vertices in each set is going to be less than or equal to 1. So a key idea in math and in life, change one thing at a time. So we might start with our partite sets having very nearly the same number of vertices. So suppose we move a single vertex from set p to set q. Note that if the absolute difference is 1, there are two possibilities. First, the number of vertices in set p might have been greater than the number of vertices in set q. But remember, we move to single vertex from p to q. So if that's the case, then all we've done is switched, which set has vp elements and which set has vq elements. So the actual cardinality of the partite sets is unchanged. Consequently, the number of edges won't change if we make this switch. So we'll suppose that vp is less than or equal to vq. If we switch a vertex from set p to set q, we'll decrease vp by 1 and increase vq by 1. So now the terms in the sum giving the total number of edges will fall into four categories. Those that include neither vp nor vq, those that involve vp only, those that involve vq only, and the single term vp vq. Since we've only changed vp and vq, the terms that involve neither factor are unchanged. The terms involving only vp will be excluding the term vp vq. Decreasing vp by 1 will decrease this sum by where vq is not included in this sum. Likewise, the terms involving only vq will be, again excluding the product vp vq, and this time increasing vq by 1 will increase this sum by where we note, again, vp is not included in this sum. Consequently, in the sum giving us the number of edges, the terms involving neither vp nor vq are unchanged. The terms involving vp but not vq will decrease by a total of where the sum excludes vq and incidentally also vp. Meanwhile, the terms involving vq but not vp will increase by a total of where the sum excludes vp and, again, also vq. But these two sums are otherwise the same because, remember, none of the other partite sets changed, so any change to the number of edges can only come because of a change in the vp vq term. What happens to that term? This term will change, p will drop by 1 and vq will increase by 1, and so it will be. But remember we're in the case where vp is less than or equal to vq. So this simplifies to, which is necessarily greater than the original product. Consequently, switching a vertex from set p to set q will decrease the total number of edges, and so making the partite sets of very nearly equal size will yield the greatest possible number of edges. Consequently, let g be a k-partite graph on v vertices. The greatest number of edges will occur if each partite set has floor v over k or floor v over k plus one vertices. Now the complete k-partite graph on v vertices where each partite set has floor v over k or floor v over k plus one vertices, and every possible edge between partite sets is formed is called the Tehran graph after Paul Tehran, and it's designated tkv. And we can restate our theorem. For any kv, the Tehran graph tkv has the greatest possible number of edges among all k-partite graphs with v vertices. For example, we might try to find the four partite graph with 11 vertices with the greatest possible number of edges. So we note that 11 divided by 4 is 2 remainder 3, so we'll form 4 sets with 2 vertices each. Now that only gives us 8 total vertices, and we do want 11, so the remaining 3 vertices will be assigned to 3 different sets. So our partite set will have 3, 3, 3, and 2 vertices, and will have 45 edges.