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.

- Los Angeles Clippers
- Miami Heat
- Portland Trail Blazers
- Milwaukee Bucks
- Dallas Mavericks
- Brooklyn Nets
- Los Angeles Lakers
- Orlando Magic
- Utah Jazz
- Chicago Bulls
- Houston Rockets
- New York Knicks
- Phoenix Suns
- Washington Wizards
- Denver Nuggets
- Cleveland Cavaliers
- Memphis Grizzlies
- Philadelphia 76ers
- Sacramento Kings
- Atlanta Hawks
- Minnesota Timberwolves
- Detroit Pistons
- New Orleans Pelicans
- Toronto Raptors
- Golden State Warriors
- Charlotte Hornets
- Oklahoma City Thunder
- Indiana Pacers
- San Antonio Spurs
- 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.

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