## Measuring the regularity of a graph by its Laplacian eigenvalues

Let ${G}$ be a graph with vertices ${1, 2, \dots, n}$. The degree of vertex ${i}$ is denoted ${d_i}$. Let ${L}$ be the Laplacian matrix of ${G}$, so that ${L_{ii}=d_i}$, ${L_{ij}}$ is ${-1}$ when the vertices ${i, j}$ are adjacent, and is ${0}$ otherwise. The eigenvalues of ${L}$ are written as ${\lambda_1\le \dots \le \lambda_n}$.

The graph is regular if all vertices have the same degree: ${d_1=\cdots = d_n}$. How can this property be seen from its Laplacian eigenvalues ${\lambda_1, \dots, \lambda_n}$?

Since the sum of eigenvalues is equal to the trace, we have ${\sum \lambda_i = \sum d_i}$. Moreover, ${\sum \lambda_i^2}$ is the trace of ${L^2}$, which is equal to the sum of the squares of all entries of ${L}$. This sum is ${\sum d_i^2 + \sum d_i}$ because the ${i}$th row of ${L}$ contains one entry equal to ${d_i}$ and ${d_i}$ entries equal to ${-1}$. In conclusion, ${\sum d_i^2 = \sum \lambda_i^2 - \sum\lambda_i}$.

The Cauchy-Schwarz inequality says that ${n\sum d_i^2 \ge \left(\sum d_i \right)^2}$ with equality if and only if all numbers ${d_i}$ are equal, i.e., the graph is regular. In terms of eigenvalues, this means that the difference
${\displaystyle D =n\sum d_i^2 - \left(\sum d_i \right)^2 = n\sum (\lambda_i^2 - \lambda_i) - \left( \sum\lambda_i \right)^2 }$
is always nonnegative, and is equal to zero precisely when the graph is regular. This is how one can see the regularity of a graph from its Laplacian spectrum.

As an aside, ${D }$ is an even integer. Indeed, the sum ${\sum d_i}$ is even because it double-counts the edges. Hence the number of vertices of odd degree is even, which implies that ${\sum d_i^k }$ is even for every positive integer  ${k }$.

Up to a constant factor, ${D}$ is simply the degree variance: the variance of the sequence ${d_1, \dots, d_n}$. What graph maximizes it for a given ${n}$? We want to have some very large degrees and some very small ones.

Let ${G_{m, n}}$ be the union of the complete graph ${K_m}$ on ${m}$ vertices and ${(n-m)}$ isolated vertices. The sum of degrees is ${m(m-1)}$ and the sum of squares of degrees is ${m(m-1)^2}$. Hence,

${D = nm(m-1)^2 - (m(m-1))^2 = m(m-1)^2(n-m)}$

For ${n=3, 4, 5, 6}$ the maximum is attained by ${m=n-1}$, that is there is one isolated vertex. For ${n=7, 8, 9, 10}$ the maximum is ${m=n-2}$. In general it is attained by ${m^*=\lfloor (3n+2)/4 \rfloor}$.

The graph ${G_{m, n}}$ is disconnected. But any graph has the same degree variance as its complement. And the complement ${G^c(m, n)}$ is always connected: it consists of a “center”, a complete graph on ${n-m}$ vertices, and “periphery”, a set of ${m}$ vertices that are connected to each central vertex. Put another way, ${G^c(m, n)}$ is obtained from the complete bipartite graph ${K_{m, n-m}}$ by connecting all vertices of the ${n-m}$ group together.

Tom A. B. Snijders (1981) proved that ${G(m^*, n)}$ and ${G^c(m^*, n)}$ are the only graphs maximizing the degree variance; in particular, ${G^c(m^*, n)}$ is the unique maximizer among the connected graphs. It is pictured below for ${n=4, \dots, 9}$.

## 2019 Formula One season

This is now a separate post from Graph theory in Formula 1 so that the evolution of the graph of 1-2 finishes can be tracked. The graphs are shown as they were after the race mentioned in the subheading. At times, when the main F1 graph remained unchanged, I threw in similar graphs for some F1 feeder series.

## Australia

Obviously, there is only one edge after the first race of the season, a Mercedes 1-2. This turned out to be the beginning of a series of five 1-2 for Mercedes, so the graph did not change again until Monaco.

## Monaco

At Monaco, Mercedes drivers took “only” the first and third place, as Vettel appeared in top 2.

## Austria

It began with the youngest ever front row of the F1 grid: Leclerc and Verstappen. And ended with the youngest ever 1-2 finish (represented by an edge here) in Formula One: Verstappen and Leclerc. For the moment, the graph is disconnected.

Two predictions: (1) the components will get connected; (2) the graph will stay with 5 vertices, tying the record for the fewest number of vertices (there were 5 in 2000 and 2011). Which is a way of saying, I don’t expect either Gasly or anyone outside of top 3 teams to finish in top two for the rest of the season.

## Germany

The rain-induced chaos in Hockenheim could have added a third component to the graph, but instead it linked the two existing ones. The graph is now a path on 5 vertices, which is not a likely structure in this context.

## Hungary

Sure, the ${P_5}$ configuration did not last. The graph is longer a tree, and nor longer bipartite.

A prediction added during the summer break: the season’s graph will contain a Hamiltonian cycle.

## Belgium

Getting closer to constructing a Hamiltonian cycle: only one degree-1 vertex remains. The graph is similar to 1992 season, except the appendage was one edge longer then.

In 1992, the central position was occupied by Mansell, who scored 93% more points than the runner-up to the title. This is where we find Hamilton at present, though with “only” 32% more points than the 2nd place. (The percentages are called for, because the scoring system changed in between.)

## Italy

A Hamiltonian cycle is now complete. The only way to lose it is by adding another vertex to the graph, which I do not expect to happen.

The graph resembles the 2001 season where Hamilton’s position was occupied by Schumacher. The only difference is that in 2001, there was an extra edge incident to Schumacher.

## Singapore

We have a 4-clique, and are two edges short of the complete graph on 5 vertices.

However, I predict the complete graph will not happen. Achieving it would require two races in which neither Hamilton nor Leclerc finishes in top two. Such a thing happened just once in the first 15 races, in the chaos of rainy Hockenheim.  Not likely to happen twice in the remaining 6.

## Russia

The Formula 1 graph did not change, which is not surprising, considering how unlikely the two missing edges are to appear (see above). But since FIA Formula 3 championship ended in Sochi, here is its complete graph.

The champion, Shwartzman, has the highest vertex degree with 5. Given the level of success of Prema team, one could expect their drivers to form a 3-clique, but this is not the case: Armstrong and Daruvala are not connected (Daruvala’s successful races were mostly toward the beginning of the season, Armstrong’s toward the end). Two Hitech drivers, Vips and Pulcini, each share a couple edges with Prema drivers. All in all, this was a closely fought championship that sometimes made Formula 1 races look like parade laps in comparison.

## Japan

Unlikely as it was, another edge was created, bringing the graph within one edge of the first non-planar season in F1.

Could we get an even more unlikely Verstappen-Bottas finish in the remaining four races? Red Bull did not look strong enough in recent races for that to happen.

## Interlude: Formula 4

The level of Formula 4 championships is highly variable: some struggle to survive with a handful of cars on the grid, some have developed into spectacular competitions. The following summary of F4 history is highly recommended.

The two most noteworthy ones are the “twin” F4 championships held in Germany and Italy which have disjoint calendars and share many of the drivers. Here is a summary of German (ADAC) F4 in 2019:

At times, US Racing team threatened to take positions 1-2-3-4 in the standings. They did get 1, 3, 4, 6 but it was a close fight, with Pourchaire taking the title by 7 points (258 : 251) over Hauger. Hauger and his neighbors in the graph (US Racing quartet and Petecof of Prema team) occupied the top 6 positions. The radius of the graph is 3, with its (unique) center being Pourchaire.

The Italian F4 championship sometimes had over 35 cars on the grid, but its 1-2 graph is smaller, of radius 2. The unique center is Hauger, who won by a landslide (Hauger 369 : 233 Petecof). The only Italian driver on the graph of this Italian championship is Ferrari who once took second place when Hauger and Petecof collided.

Arguably, Hauger is the 2019 driver of the year at F4 level: he won 6 races in ADAC F4 and 12 in Italian F4. Pourchaire won 4 races in ADAC F4 and did not participate in Italian F4.

Another fascinating contest was the season-long battle of two 15-year old F4 rookies: Aron and Stanek. Stanek took ADAC F4 rookie title, Aron did likewise in Italy. One can call it a tie, with a rematch likely next year unless they move to different categories. Mercedes-backed Aron gets more media attention so far.

## Mexico

No new edge, just another repeat of Hamilton-Vettel pairing: it is the 55th time they took the top two spots in Formula 1, an all-time record. They are adjacent on every graph since 2010 except for 2013, where Hamilton’s only race win came with Vettel finishing 3rd. They were also 1-3 in Japan 2009, so one has to go back to 2008, when Vettel drove for Toro Rosso, to find a season where they did not share the podium.

Meanwhile, Formula Renault Eurocup 2019 season ended, so here is its summary graph.

As usual, the highest vertex degree (Piastri, 6) indicates the champion. The 4-clique in the center of the large component took the top 4 places. The small component De Wilde – Lorandi comes from the season opener, where JD Motorsport team claimed the top two. Neither driver was in top two again, as the rest of the season was almost entirely a contest between R-ace GP and MP Motorsport. Not obvious from the graph: despite only appearing in top 2 once, as a second place in Spa, Collet took a handful of 3rd and 4th places on his way to the 5th place in overall standings and the top rookie title. The gap between 5th and 6th places was 207:102, more than a factor of 2, and the championship often felt like there were only 5 cars in the running, all from R-ace GP or MP Motorsport.

## United States

It was so close to Bottas-Verstappen finish, which would have completed the graph to ${K_5}$, making it the first non-planar F1 graph in history. Could be that some Law of Planarity interfered, causing the yellow flags that denied Verstappen that final chance at overtaking Hamilton. No change to the graph, then.

Another feeder series fills up the spot, then: Formula Regional European Championship (FREC). An unimpressive affair from start to finish, to be frank. Yes, it was the first year the championship took place, and it’s supposed to play an important role as a stepping stone from F4 to FIA F3. (Few drivers can realistically jump into international F3 competition directly from F4, with Hauger and Pourchaire likely to be the only two to pull off this move in 2020.) Still, it is a travesty to award 25 Super License points – same as in Japanese Super Formula – for beating this small field of mostly under-tested cars and some under-prepared drivers. As Floersch put it,

Prema had three cars since November, so they’d been testing since November with three guys who actually can also drive. We had the cars one week before Paul Ricard and had one driver.

At least it was pretty close to a wheel graph. At its center, Vesti won the championship by a wide margin. I included the Fraga-Guzman edge based on my recollection of Guzman finishing second in the second race at Monza – the official standings table gives Guzman no points for any Monza race, as if there was a post-race DQ that nobody mentioned to the press (but given the level of organization, I would not be surprised if it was a clerical error).

## Brazil

Funny how predictions work sometimes. After the Austrian Grand Prix, when Gasly was still with Red Bull, I wrote

I don’t expect either Gasly or anyone outside of top 3 teams to finish in top two for the rest of the season.

But Gasly dropped out of a top-3 team and then finished second in Brazil.

Well, my prediction did not cover the Toro Rosso version of Gasly, who now looks like a different driver inhabiting the same body, Jekyll/Hyde style.

This race also broke the Hamiltonian cycle, and the only chance for it to be recovered is for Gasly to finish in top two again in Abu Dhabi.

## Abu Dhabi

At the end of the season, the Formula 1 graph stayed as it was after Brazil, shown just above. But as Formula 2 season also ended there, here is its graph.

The highest degree vertex belongs to the champion de Vries. Surprisingly, the vice champion Latifi only has degree 3, less than Ghiotto, Aitken, and Matsushita who finished in places 3, 5, 6.  Hubert and Correa are joined by an edge due to Hubert’s win in the sprint race in France. Two months later, their collision in Belgium ended Hubert’s life and possibly ended Correa’s racing career. Hubert took the 10th place in the championship posthumously.

## Graph theory in Formula 1

This post attempts to visualize Formula 1 championships (1985-2018) by way of graphs: the outcome of each race is represented by an edge between the drivers who finished #1 and #2. The graph is undirected (no distinction between the winner and 2nd place is made), and simple (no record of multiple edges is kept). This erases some of the information, but depending on how much you care about F1, the graphs may still be enough to bring back some memories.

All graph-theoretical “records” are based on 1985-2018 data only, 2019 season being the subject of a separate post. Some highlights:

• Most vertices: 12 in 1997
• Fewest vertices: 5 in 2000 and 2011
• Most edges: 16 in 2012
• Fewest edges: 6 in 1988, 2002, 2011, and 2015
• Largest maximal degree: 6 in 1990, 1997, 2004, and 2012
• Smallest maximal degree: 3 in 1996
• Largest minimal degree: 2 in 1989, 2016, and 2018
• Largest diameter: 6 in 2009
• Smallest diameter: 2 in 1993, 2000, 2001, 2002, 2007, 2011, and 2016
• Disconnected: 1985, 1991, 1996, 1998, 1999, 2006, and 2008
• Isomorphic seasons: 1991 and 1998
• Hamiltonian cycle: 2016 and 2018
• Triangle-free: none (hence no trees and no bipartite graphs)

Appropriately, both Hamiltonian cycles include Hamilton.

## 1985 season

This was the year of Senna’s first race victory, but the championship went to Prost, who shared maximal vertex degree (4) with Rosberg (Keke Rosberg, of course, not his son Nico Rosberg). This is also one of the few seasons with a disconnected graph. A small connected component, such as Angelis-Boutsen here, likely indicates something weird… in this case, the 1985 San Marino Grand Prix at Imola where Senna ran out of fuel and Prost was disqualified.

## 1986 season

Prost won again, this time with vertex degree 5.

## 1987 season

The four-way battle between Mansell, Piquet, Prost, and Senna fell just short of creating a complete subgraph on four vertices. Their best chance of creating ${K_4}$ was at Detroit, where Senna won and Prost was 3rd. Piquet won the championship.

## 1988 season

The graph is smaller than the previous ones, but is actually larger than one would expect, considering that Senna and Prost combined for 15 wins in 16 races. Berger extended this graph by his win at Monza, in the season otherwise dominated by McLaren. The graph also suggests that Prost should win the championship, and he would have if the champion was determined by the total of all points earned as it is now. But only the best 11 results counted then, and Senna won by that metric.

## 1989 season

Again just an edge short of ${K_4}$ subgraph, but this time it was not a four-way battle at all. Berger only finished 3 races (but in top two every time). Senna and Mansell also had too many retirements to challenge Prost for the championship. This is the first time we see a graph with no vertices of degree 1. But there is no Hamiltonian cycle here.

## 1990 season

The first time we see a degree of vertex 6, and the second time Senna is the champion.

## 1991 season

Another disconnected graph, with Piquet scoring his last career victory in Canada under strange circumstances: Mansell’s car stopped on the last lap when he led by almost a minute and was already waving to the crowd.

If such a mishap also happened at Silverstone, where Mansell, Berger, and Prost finished 1-2-3, we would have ${K_4}$ as a subgraph. Senna won the championship for the last time.

## 1992 season

Sorry about Schumacher’s name being cut off… this was the year of his first race win, at Spa-Francorchamps. Meanwhile, Mansell utterly dominated the championship.

## 1993 season

The first time we get a graph of diameter 2. It suggests Hill was the winner, but in reality he finished third in the championship, with Prost winning for the last time in his career.

## 1994 season

The year of Senna’s death; he does not appear on the graph. Hill has the vertex degree of 5, but Schumacher won the championship by 1 point after their controversial collision at Adelaide.

## 1995 season

That’s pretty close to the wheel graph on six vertices – the only missing edge is Häkkinen-Coulthard. They would score a lot of 1-2 finishes for McLaren in the years to come, but at this time they were not teammates yet. At the center of the incomplete wheel, Schumacher won the championship by a wide margin.

## 1996 season

Another small component, another highly unusual race: wet Monaco Grand Prix, where only three cars made it to the finish and Panis scored the only victory of his career.

Hill won the championship in which no driver had vertex degree greater than 3, the only such season in our record.

## 1997 season

This season holds the record for the number of vertices (12). Two vertices have degree 6 (Villeneuve and Schumacher) but surprisingly, there is no edge between them. Although one of them was on the podium in every race except Italy, they were never on the podium together. Their infamous collision in the season finale at Jerez led to Schumacher being disqualified from the championship.

Villeneuve became the last non-European F1 champion to date.

## 1998 season

The small component is due to Carmageddon on the first lap of very wet Belgian Grand Prix.

This is where my decision to include only driver’s last names backfires: Ralf Schumacher gets to keep his initial. In other news, Williams suddenly faded from the picture and McLaren re-emerged with Häkkinen and Coulthard finishing 1-2 in five races. Häkkinen won the championship.

The seasons 1991 and 1998 is the only pair of isomorphic graphs in this collection. An isomorphism maps Schumacher and Häkkinen to Senna and Mansell.

## 1999 season

The small component is contributed by the partially wet Nürburgring race, where multiple retirements among the leaders left Herbert to score his last Grand Prix victory.

Schumacher’s injury at Silverstone took him out of contention. Still, the second championship of Häkkinen was a lot closer than the first one: he won by 2 points over Irvine.

## 2000 season

Finally, we get a complete subgraph on four vertices: the Ferrari and McLaren drivers. The sole appearance of a driver outside of these two teams was at Brazilian Grand Prix, where Fisichella finished 3rd but was promoted to 2nd after Coulthard’s disqualification. If not for this incident, we would have a regular graph in this collection, a rather unlikely event. Even so, this season set the record for fewest vertices (5). A closely fought championship ended with Schumacher collecting his third title.

## 2001 season

This was not close at all: the driver at the center of this diameter 2 graph won with a lot of room to spare.

## 2002 season

Another season of diameter 2. Schumacher finished every race in top two, except for the Malaysian Grand Prix, narrowly missing an opportunity to create a tree (a star graph). This season ties the fewest edges record (6) which was set in 1998.

## 2003 season

More vertices and larger diameter indicates a more interesting season. Schumacher won again, but by mere 2 points over Räikkönen.

## 2004 season

The final season of Schumacher/Ferrari dominance, in which Schumacher won 13 races and achieved the vertex degree of 6.

## 2005 season

This looks like it was between Alonso and Räikkönen – and it was, with Alonso becoming the youngest F1 champion yet.

## 2006 season

Button’s first career win (wet Hungarian Grand Prix) created the small component.

The large component has diameter 2, with Alonso (the champion) in its center. This is also the last graph in which Schumacher appears.

## 2007 season

As in 2000, Ferrari and McLaren combine to form a complete subgraph on four vertices. But this championship fight was as close as one could imagine, with three drivers finishing within one point: Räikkönen 110, Hamilton 109, Alonso 109. And this was Hamilton’s first season in F1.

## 2008 season

For the first time, we have a small component with more than two vertices. Kovalainen’s only F1 victory came in Hungary, where Glock took second place. More notable was Vettel’s first victory, which came in Monza and made him the youngest driver to win a F1 race [up to that time]. Even more notably, Hamilton won the championship by one point, at the end of the final lap of the final race, and became the youngest F1 champion at that time. Here is the Glock’s view of the action, his car slip-sliding on dry-weather tyres.

On the graph, “Jr.” is Piquet Jr. who took second place in Germany but his brief stint in Formula 1 would be remembered for an entirely different reason.

## 2009 season

The graph of largest diameter (6) captures a strange season after major rule changes. It is so close to being a complex tree, but the 3-cycle was completed at Istanbul, where the polesitter Vettel lost the lead on the first lap and then fell behind his Red Bull teammate Webber as well, finishing just 0.7 seconds behind in the 3rd place. If Vettel was first or second in Turkey, we would have a tree. Button won the championship on the strength of the first half of the season.

## 2010 season

The third time we see a ${K_4}$ subgraph, but the first time that it involves more than two teams: the vertices come from Red Bull (Vettel and Webber), McLaren (Hamilton), and Ferrari (Alonso). Although Vettel’s vertex degree is only 3, trailing Hamilton’s 4 and Alonso’s 5, he became the youngest F1 champion in history, a record he still holds.

## 2011 season

The season tied 2000 for the fewest vertices, with 5. The fewest edges record (6) is tied as well: it was McLaren in 1988 and Ferrari in 2002; this time it is Red Bull’s turn. Vettel won the championship by 122 points but it’s not all in the car; his teammate Webber finished only third.

## 2012 season

With 16 edges, this season beat the previous record set by 1997 season, even though there are fewer vertices here. The two degree-6 vertices led the way in the championship, with Vettel beating Alonso by 3 points. Was this the last great season to watch?

## 2013 season

Vettel over Alonso again, but by 155 points this time. This was the last season of V8 engines, and last season of Red Bull domination. Hamilton appears on the graph only because of his victory in Hungary, after which Vettel won the remaining 9 races. The season opener turned out to be the last race [at the time of writing] won by someone not driving Mercedes, Ferrari, or Red Bull:

## 2014 season

The beginning of a new era: V6 hybrid engine, Mercedes, and Hamilton. Also the last time we see a McLaren driver (Magnussen) on the graph: he appears because of the 2nd place in the dramatic season opener.

In a brief moment of Williams resurgence, Bottas took 2nd place in Britain and Germany, forming a cycle with the Mercedes drivers. If not for him, we would have a tree.

## 2015 season

Another 6-edge graph, another season without much competition. Vettel was the only driver to challenge Mercedes on occasions, thus contributing a cycle to the graph. The entire graph is formed by Mercedes, Ferrari, and Red Bull. Hamilton won the championship again.

## 2016 season

The first time we get a Hamiltonian cycle, for example: Hamilton, Vettel, Rosberg, Räikkönen, Verstappen, Ricciardo, and back to Hamilton. Another 6-vertex graph formed by Mercedes, Ferrari, and Red Bull exclusively. Among them, Mercedes and Red Bull drivers form a complete subgraph. With Ferrari fading to third, neither Vettel nor Räikkönen had enough success to extend ${K_4}$ to ${K_5}$ and thus create the first non-planar season. We would have ${K_5}$ if (a) Räikkönen overtook Verstappen in Austria (he was 0.3s behind), after Hamilton and Rosberg collided on the last lap:

and (b) Räikkönen finished 2nd instead of the 4th in Malaysia, where Hamilton’s engine went up in smoke, costing him the championship.

As it happened, we did not get ${K_5}$ and Hamilton did not get the championship, which went to Rosberg instead. But Verstappen got his first victory at Barcelona and still remains the youngest driver ever to win an F1 race.

## 2017 season

Once again, it is all about Mercedes, Ferrari, and Red Bull, with the Mercedes drivers enjoying higher vertex degree. But this time Ferrari drivers are connected by an edge. The last 1-2 finish of Ferrari to date was in Hungary, arguably their high point of the season.

It was all about Hamilton the rest of the season.

## 2018 season

Second time a Hamiltonian cycle appears, for example: Hamilton, Räikkönen, Verstappen, Vettel, Ricciardo, Bottas, and back to Hamilton. Fourth year in a row that only Mercedes, Ferrari, and Red Bull drivers appear on the graph. Second year in a row that Hamilton wins, and his fifth time overall.

## 2019 season

So close to a 5-clique, only one edge is missing: Bottas-Verstappen. It looked like they could finish 1-2 in Austin, but the Law of Planarity would not allow it, causing yellow flags that prevented Verstappen from an attempt at moving from 3rd to 2nd. Hamilton shared the maximal vertex degree with Verstappen, Leclerc, and Vettel, but was never threatened by any of them in the championship.

## Laplacian spectrum of small graphs

This is a collection of entirely unoriginal remarks about Laplacian spectrum of graphs. For an accessible overview of the subject I recommend the M.S. thesis The Laplacian Spectrum of Graphs by Michael William Newman. It also includes a large table of graphs with their spectra. Here I will avoid introducing matrices and enumerating vertices.

Let ${V}$ be the vertex set of a graph. Write ${u\sim v}$ if ${u, v}$ are adjacent vertices. Given a function ${f\colon V\to \mathbb R}$, define ${L f(v) = \sum_{u\colon u\sim v}(f(v)-f(u))}$.
This is a linear operator (the graph Laplacian) on the Euclidean space ${\ell^2(V)}$ of all functions ${f\colon V\to \mathbb R}$ with the norm ${\|f\|^2 = \sum_{v\in V} f(v)^2}$. It is symmetric: ${\langle L f, g\rangle = \langle f, L g\rangle }$ and positive semidefinite: ${\langle L f, f\rangle = \frac12 \sum_{u\sim v}(f(u)-f(v))^2\ge 0}$. Since equality is attained for constant ${f}$, 0 is always an eigenvalue of ${L}$.

This is the standard setup, but I prefer to change things a little and replace ${\ell^2(V)}$ by the smaller space ${\ell^2_0(V)}$ of functions with zero mean: ${\sum_{v\in V}f(v)=0}$. Indeed, ${L}$ maps ${\ell^2(V)}$ to ${\ell^2_0(V)}$ anyway, and since it kills the constants, it makes sense to focus on ${\ell^2_0(V)}$. It is a vector space of dimension ${n-1}$ where ${n=|V|}$.

One advantage is that the smallest eigenvalue is 0 if and only if the graph is disconnected: indeed, ${\langle L f, f\rangle=0}$ is equivalent to ${f}$ being constant on each connected component. We also gain better symmetry between ${L}$ and the Laplacian of the graph complement, denoted ${L'}$. Indeed, since ${L' f(v) = \sum_{u\colon u\not \sim v}(f(v)-f(u))}$, it follows that ${(L+L')f(v) = \sum_{u\colon u\ne v} (f(v)-f(u)) = n f(v)}$ for every ${f\in \ell^2_0(V)}$. So, the identity ${L+L' = nI}$ holds on ${\ell^2_0(V)}$ (it does not hold on ${\ell^2(V)}$). Hence the eigenvalues of ${L'}$ are obtained by subtracting the eigenvalues of ${L}$ from ${n}$. As a corollary, the largest eigenvalue of ${L}$ is at most ${n}$, with equality if and only if the graph complement is disconnected. More precisely, the multiplicity of eigenvalue ${n}$ is one less than the number of connected components of the graph complement.

Let ${D}$ denote the diameter of the graph. Then the number of distinct Laplacian eigenvalues is at least ${D}$. Indeed, let ${u, v}$ be two vertices at distance ${D}$ from each other. Define ${f_0(u) = 1}$ and ${f_0=0}$ elsewhere. Also let ${f_k=L^k f_0}$ for ${k=1, 2, \dots}$. Note that ${f_k\in \ell_0^2(V)}$ for all ${k\ge 1}$. One can prove by induction that ${f_k(w)=0}$ when the distance from ${w}$ to ${u}$ is greater than ${k}$, and ${(-1)^k f_k(w) > 0}$ when the distance from ${w}$ to ${u}$ is equal to ${k}$. In particular, ${f_k(v) = 0}$ when ${k and ${f_D(v)\ne 0}$. This shows that ${f_D}$ is not a linear combination of ${f_1, \dots, f_{D-1}}$. Since ${f_k = L^{k-1}f_1}$, it follows that ${L^{D-1}}$ is not a linear combination of ${L^0, L^1, \dots, L^{D-2}}$. Hence the minimal polynomial of ${L}$ has degree at least ${D}$, which implies the claim.

Let’s consider a few examples of connected graphs.

## 3 vertices

There are two connected graphs: the 3-path (D=2) and the 3-cycle (D=1). In both cases we get D distinct eigenvalues. The spectra are [1, 3] and [3, 3], respectively.

## 4 vertices

• One graph of diameter 3, the path. Its spectrum is ${[2-\sqrt{2}, 2, 2+\sqrt{2}]}$.
• One graph of diameter 1, the complete graph. Its spectrum is ${[4, 4, 4]}$. This pattern continues for other complete graphs: since the complement is the empty graph (${n}$ components), all ${n-1}$ eigenvalues are equal to ${n}$.
• Four graphs of diameter 2, which are shown below, with each caption being the spectrum.

Remarks:

• The graph [1, 3, 4] has more distinct eigenvalues than its diameter.
• The graph [2, 2, 4] is regular (all vertices have the same degree).
• The smallest eigenvalue of graphs [1, 1, 4] and [2, 2, 4] is multiple, due to the graphs having a large group of automorphisms (here rotations); applying some of these automorphisms to an eigenfunctions for the smallest eigenvalue yields another eigenfunction.
• [1, 3, 4] and [2, 4, 4] also have automorphisms, but their automorphisms preserve the eigenfunction for the lowest eigenvalue, up to a constant factor.

## 5 vertices

• One graph of diameter 4, the path. Its spectrum is related to the golden ratio: it consists of ${(3\pm \sqrt{5})/2, (5\pm \sqrt{5})/2}$.
• One graph of diameter 1, the complete one: [5, 5, 5, 5]
• Five graphs of diameter 3. All have connected complement, with the highest eigenvalue strictly between 4 and 5. None are regular. Each has 4 distinct eigenvalues.
• 14 graphs of diameter 2. Some of these are noted below.

Two have connected complement, so their eigenvalues are less than 5 (spectrum shown on hover):

One has both integers and non-integers in its spectrum, the smallest such graph. Its eigenvalues are ${3\pm \sqrt{2}, 3, 5}$.

Two have eigenvalues of multiplicity 3, indicating a high degree of symmetry (spectrum shown on hover).

Two have all eigenvalues integer and distinct:

The 5-cycle and the complete graph are the only regular graphs on 5 vertices.

## 6 vertices

This is where we first encounter isospectral graphs: the Laplacian spectrum cannot tell them apart.

Both of these have spectrum ${3\pm \sqrt{5}, 2, 3, 3}$ but they are obviously non-isomorphic (consider the vertex degrees):

Both have these have spectrum ${3\pm \sqrt{5}, 3, 3, 4}$ and are non-isomorphic.

Indeed, the second pair is obtained from the first by taking graph complement.

Also notable are regular graphs on 6 vertices, all of which have integer spectrum.

Here [3, 3, 3, 3, 6] (complete bipartite) and [2, 3, 3, 5, 5] (prism) are both regular of degree 3, but the spectrum allows us to tell them apart.

The prism is the smallest regular graph for which the first eigenvalue is a simple one. It has plenty of automorphisms, but the relevant eigenfunction (1 on one face of the prism, -1 on the other face) is compatible with all of them.

## 7 vertices

There are four regular graphs on 7 vertices. Two of them are by now familiar: 7-cycle and complete graph. Here are the other two, both regular of degree 4 but with different spectra.

There are lots of isospectral pairs of graphs on 7 vertices, so I will list only the isospectral triples, of which there are five.

Spectrum 0.676596, 2, 3, 3.642074, 5, 5.681331:

Spectrum 0.726927, 2, 3.140435, 4, 4, 6.132637:

Spectrum 0.867363, 3, 3, 3.859565, 5, 6.273073:

Spectrum 1.318669, 2, 3.357926, 4, 5, 6.323404:

All of the triples mentioned so far have connected complement: for example, taking the complement of the triple with the spectrum [0.676596, 2, 3, 3.642074, 5, 5.681331] turns it into the triple with the spectrum [1.318669, 2, 3.357926, 4, 5, 6.323404].

Last but not least, an isospectral triple with an integer spectrum: 3, 4, 4, 6, 6, 7. This one has no counterpart since the complement of each of these graphs is disconnected.

## 8 vertices

Regular graphs, excluding the cycle (spectrum 0.585786, 0.585786, 2, 2, 3.414214, 3.414214, 4) and the complete one.

#### Degree 6 regular

Credits: the list of graphs by Brendan McKay and NetworkX library specifically the methods read_graph6 (to read the files provided by Prof. McKay), laplacian_spectrum, diameter, degree, and draw.

## The infinitely big picture: tanh-tanh scale

When plotting the familiar elementary functions like x2 or exp(x), we only see whatever part of the infinitely long curve fits in the plot window. What if we could see the entire curve at once?

The double-tanh scale can help with that. The function u = tanh(x) is a diffeomorphism of the real line onto the interval (-1, 1). Its inverse, arctanh or artanh or arth or ${\tanh^{-1}x}$ or ${\frac12 \log((1+x)/(1-x))}$, whatever you prefer to call it, does the opposite. So, conjugating any function ${f\colon \mathbb R\to \mathbb R}$ by the hyperbolic tangent produces a function ${g\colon (-1, 1)\to (-1,1)}$ which we can plot in its entirety. Let’s try this.

Out of linear functions y = kx, only y=x and y=-x remain lines.

The powers of x, from 1 to 4, look mostly familiar:

Sine, cosine, and tangent functions are not periodic anymore:

The exponential function looks concave instead of convex, although I don’t recommend trying to prove this by taking the second derivative of its tanh-conjugate.

The Gaussian loses its bell-shaped appearance and becomes suspiciously similar to a semicircle.

This raises the question: which function does appear as a perfect semi-circle of radius 1 on the tanh-tanh scale? Turns out, it is ${f(x) = \log|\coth(x/2)|}$. Here it is shown in the normal coordinate system.

## Graphs with an invertible incidence matrix

Graphs are often encoded by their adjacency matrix: a symmetric matrix where ${1}$ in the entry ${(i,j)}$ means there is an edge between vertices labeled ${i}$ and ${j}$. Another useful encoding is the incidence matrix, in which rows correspond to edges and columns to vertices (or the other way around). Having ${1}$ in the entry ${(i,j)}$ means that ${i}$th edge is incident to ${j}$th vertex. Simply put, each row contains exactly two nonzero entries, which indicate the endpoints of an edge.

An incidence matrix is generally rectangular. It is the square matrix when the graph has as many edges as vertices. For example, the 4-cycle has incidence matrix

${M = \displaystyle \begin{pmatrix} 1 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 \\ 0 & 0 & 1 & 1 \\ 1 & 0 & 0 & 1 \end{pmatrix}}$

(up to relabeling of vertices). This matrix is not invertible. Indeed, ${M(1,-1,1,-1)^T=0}$, which is a reflection of the fact that the graph is bipartite. Indeed, for any bipartite graph the ${\pm 1}$ vector describing a 2-coloring of the vertices belongs to the kernel of the incidence matrix.

The incidence matrix of an odd cycle is invertible, however. What other such “invertible” graphs exist? Clearly, the disjoint union of “invertible” graphs is itself invertible, so we can focus on connected graphs.

There are no invertible graphs on 1 or 2 vertices. For 3 through 8 vertices, exhaustive search yields the following counts:

• 1 graph on 3 vertices (3-cycle)
• 1 graph on 4 vertices (3-cycle with an edge attached)
• 4 graphs on 5 vertices
• 8 graphs on 6 vertices
• 23 graphs on 7 vertices
• 55 graphs on 8 vertices

The numbers match the OEIS sequence A181688 but it’s not clear whether this is for real or a coincidence. The brute force search takes long for more than 8 vertices. It’s probably better to count such graphs by using their (folklore?) characterization as “trees planted on an odd cycle”, described by Chris Godsil on MathOverflow.

Some examples:

The examples were found and plotted by this Python script.

import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from itertools import combinations

def is_invertible(graph, n):
matrix = []
for i in range(n):
row = [0]*n
row[graph[i][0]] = 1
row[graph[i][1]] = 1
matrix.append(row)
return abs(np.linalg.det(matrix)) > 0.5

n = 6   # number of vertices
graphs = combinations(combinations(range(n), 2), n)
inv = []
for g in graphs:
if is_invertible(g, n):
gr = nx.Graph(g)
if nx.is_connected(gr) and not any([nx.is_isomorphic(gr, gr2) for gr2 in inv]):
inv.append(gr)
nx.draw_networkx(gr)
plt.savefig("graph{}_{}.png".format(n, len(inv)))
plt.clf()

print("There are {} connected invertible graphs with {} vertices".format(len(inv), n))

## Random graphs with two-sided degree bounds

I wanted some random examples of graphs where every vertex has degree between two given parameters, minDegree and maxDegree. Like this one:

The approach I took was very simple (and not suitable for construction of very large or very regular graphs). Each edge appears with probability p. If the minimal degree is too small, this probability is multiplied by 1.1. If the maximal degree is too big, the probability is divided by 1.1. Either way, the process repeats until success.

So far, this blog had too much Matlab/Scilab and not enough Python. I’ll try to restore the balance. Here, numpy generates random matrices and takes care of degree restrictions; networkx lays out the graph.

import numpy as np
import networkx as nx
import matplotlib.pyplot as plt

vertices = 15
minDegree = 3
maxDegree = 4
p = 0.5
success = False

while not success:
a = (np.random.random((vertices, vertices)) < p).astype(int)
a = np.maximum(a, np.matrix.transpose(a))
np.fill_diagonal(a, 0)
s = a.sum(axis=1)
success = True
if min(s) < minDegree:
success = False
p = p * 1.1
if max(s) > maxDegree:
success = False
p = p / 1.1
g = nx.Graph(a)
nx.draw_networkx(g)
plt.show()

One more time: