# The NBA and MLB trees are isomorphic

An isomorphism is a structure-preserving function from one object to another. In the context of graphs, an isomorphism is a function that maps the vertices of one graph onto the vertices of another, preserving all the edges.

So if G and H are graphs, and f is an isomorphism between G and H, nodes x and y are connected in G if and only if nodes f(x) and f(y) are connected in H.

There are 30 basketball teams in the National Basketball Association (NBA) and 30 baseball teams in Major League Baseball (MLB). That means the NBA and MLB are isomorphic as sets, but it doesn’t necessarily mean that the hierarchical structure of the two organizations are the same. But in fact the hierarchies are the same.

Both the NBA and MLB have two top-level divisions, each divided into three subdivisions, each containing five teams.

Basketball has an Eastern Conference and a Western Conference, whereas baseball has an American League and a National League. Each basketball conference is divided into three divisions, just like baseball leagues, and each division has five teams, just as in baseball. So the tree structures of the two organizations are the same.

In the earlier post about the MLB tree structure, I showed how you could number baseball teams so that the team number n could tell you the league, division, and order within a division by taking the remainders when n is divided by 2, 3, and 5. Because the NBA tree structure is isomorphic, the same applies to the NBA.

Here’s a portion of the graph with numbering. The full version is available here as a PDF.

Here’s the ordering.

1. Los Angeles Clippers
2. Miami Heat
3. Portland Trail Blazers
4. Milwaukee Bucks
5. Dallas Mavericks
6. Brooklyn Nets
7. Los Angeles Lakers
8. Orlando Magic
9. Utah Jazz
10. Chicago Bulls
11. Houston Rockets
12. New York Knicks
13. Phoenix Suns
14. Washington Wizards
15. Denver Nuggets
16. Cleveland Cavaliers
17. Memphis Grizzlies
19. Sacramento Kings
20. Atlanta Hawks
21. Minnesota Timberwolves
22. Detroit Pistons
23. New Orleans Pelicans
24. Toronto Raptors
25. Golden State Warriors
26. Charlotte Hornets
27. Oklahoma City Thunder
28. Indiana Pacers
29. San Antonio Spurs
30. Boston Celtics

Incidentally, the images at the top of the post were created with DALL-E. They look nice overall, but you’ll see bizarre details if you look too closely.

## One thought on “The NBA and MLB trees are isomorphic”

1. Jorge Raposo

Nice post! The Wall-E graph generation is a neat feature. I’m left wondering which NBA team corresponds to post 10.