Six Degrees of Formula One and Other inter-connections

Pratik Chowdhury
6 min readAug 27, 2020

https://pratikpc.github.io/six-degree-f1/

1. And the Winner of Six Degrees of Formula One is…

Jacky Ickx

Six Degrees of Formula One is based on the famous Six Degrees of Separation in which we try to find out how far is someone from another famous individual. While according to the theory, every individual on this planet is on an average I’d say Six Connections away, when it comes to Formula One, we shall stick to teammates to make it interesting since most of the paddock is very friendly and barring very few one race participants, they all almost know each other well.

Jacky Ickx, who finished runner-up twice in Formula One (’69 and ‘70) and won the 24 Hours of Le Mans six times in 3 decades is our winner of Six Degrees of Formula One.

Six Degrees of Formula One Winner

The interesting part here is that Jacky Ickx, Mario Andretti and Graham Hill were all teammates at one point in their careers

1.2 And the Farthest from Everyone is…

Jimmy Reece

As expected, Jimmy Reece drove only in the Indy 500s before his demise in 1958 in an accident in Trenton. His lead in this not slender like Jacky’s. He’s almost an entire step ahead

As you can see, Kurt Adolff and Max de Terra were both team mates and drove in the European sections of Formula One. Their links to the outside world would have been zero had it not been for their teammate, Peter Hirt

2.1 SHORTEST PATH FROM 2020 to 1950

Kimi

As would be obvious, The King of Spa, the most experienced driver on the grid, wins this one easily.

Evolution of Shortest Distances between teammates

2.2 Longest Shortest Path possible between 1950 to 2020

And the Winner is…

Alexander Albon

Via Alexander Albon, we can take the Longest Short Paths possible from 2020 to 1950

2.2 Longest of the Shortest Path of drivers from 1950 to2020

Most people might answer the question differently. They might say, Okay Instead of finding the longest route from Albon to 1950, find the shortest route of all drivers from 1950 -> 2020 and then tell me who has the longest route in this scenario.

Out here, it’s shared by Alexander Albon and Pierre Gasly

2.3 What else can I use the website for?

Good question. You can use the website to find out teammate relationships and the distances of one driver, team or season to another

3. METHODOLOGY (Optional)

So I wanted to practice Graphing Algorithms and decided what better way to do so, than do an interlinking of Formula One teammates over the years.

So here I’ll explain the steps undertaken behind the project.

3.1 Source of Data

The data about teammates has been source by scraping FIA’s own recommended sources for information for Formula One statistics, which was the easiest to access and decipher and lists Test Drivers also. Wikipedia misses out on a lot of test drivers.

3.2 Teammate Definition

Based on how the data source is structured, Two Drivers are defined as teammates if they drove for the same team in the same season.

3.3 Shortest Path

The shortest route possible to get from A -> B

3.4 Farthest Path

This only works when both parties are not drivers.

It showcases the Longest Path between the two components possible when each path is actually the shortest one.

For example, let us say that we want to find the distance between McLaren and Romain Grosjean, then we would look at all drivers in McLaren history, and select the one closest to Romain Grosjean. In this case, we’d have Fernando Alonso, Kimi Räikkönen and Kevin Magnussen who all have over the years driven for McLaren (and have won podium(s) with them). As such, the distance of Romain to McLaren is One

3.4 Technologies Used

  1. React
  2. TypeScript
  3. Node.JS

4. STEPS FOLLOWED (Optional)

4.1 Extract Data

This library parses the data source first and extracts metadata like

  1. The Names of the Drivers
  2. The Names of Teams
  3. The teams Driver(s) drove for in a given season
  4. The List of all Teammates of a driver
  5. All Drivers to have Driven for a Team

To perform extraction of data, I used Cheerio.JS

4.2 Find Path Lengths and Paths between Drivers

Floyd Warshall

Used the Floyd-Warshall Algorithm to find the Shortest Path Tree and Shortest Path Lengths between all the nodes

  1. Store Shortest Distances between Drivers
  2. Store the Minimum Path Reconstruction Tree to be used to get from one driver to another

Now we use the Path and Distance selected and get the Average Distance between all Drivers.

Floyd Warshall

4.3 Find Largest Connected Component of Graph

So what do you think the Average Distance of Al Pease (famous for being DSQed for driving too slow) would be to everyone he’s connected to? The answer is 1. He’s only connected to himself. As such, we need to ignore the drivers who are not connected to most of the drivers

4.3.1 Depth First Search

Source. GeeksForGeeks.

To solve this, we need to use Depth First Search

We select 0,1,2 because it is the largest subcomponent

Connected Components DFS

4.4 Six Degrees of Formula One Calculation

Now we calculate Six Degrees of Formula One by finding out the Average Distances of each vertex to the rest

5. Enough. Show me the code

You can access it from 3 Repositories. The READMEs contain the required documentation. The libraries are written in TypeScript and are web compatible

  1. Metadata
  2. Graph Utils

5.1 Website Code

5.2 JSON Files generated from Dataset

The Directory contains all JSON Files Used by Us

6. Issues

We suffer from an age old problem. The dataset in use was not designed to solve this problem. As a result, I imagine that a few complaints people might have would be regarding the definition of teammates.

For example, this dataset would lead to us interpreting that Carlos Sainz Jr., who replaced Jolyon Palmer at Renault were teammates, something, not a lot of people would agree with. The issue with this is that there isn’t any other better dataset that lists all drivers who were involved with a team.

For example, Dan Ticktum, who is somewhat popular for the wrong reasons is not listed as a RBR driver by Wikipedia, another data source even if he did participate in Tests for Red Bull

6.1 Dataset is not very clean

We all work within the constraints of the dataset which has errors, fixing all of which maybe a monumental task in itself.

  1. Dataset lists 2 drivers named Rodolfo González who drove for the same team
  2. McLaren being classified as Lola in 2018 by the FIA, which does not affect the team links because luckily enough, Lando, Fernando and Stoff had all driven for McLaren before and/or after.

7. Contact me

You can contact me via LinkedIn.

--

--