19

The Morphy number is a measure of how closely a chess player is connected to Paul Morphy (1837–1884) by way of playing chess games. It's analogous to the Erdős Number for mathematicians.

People who played a chess game with Morphy have a Morphy number of 1. Players who did not play Morphy but played someone with a Morphy number of 1 have a Morphy number of 2. People who played someone with a Morphy number of n have a Morphy number of n+1.

In my case, in the early 1980s, I played Jonathan Penrose in a simultaneous exhibition, the cosmic significance of which was unknown to me at the time. Penrose is one of the few living MN3 players, having played Savielly Tartakower in 1950, who played James Mortimer in 1907, who played Paul Morphy himself "hundreds of times" from 1853. So that gives me MN4. A bit lucky: if I hadn't got that connection to Penrose, I might be hard-pressed to find my number.

So how does someone go about finding their Morphy number more systematically? Has anyone data-mined chess games databases from this perspective? Have any results been published? What are the paths implied in the Wikipedia article linked above from the MN1 to MN2 to ... to MN5 players listed there? And what's the expected MN for an active player today?

EDIT: has anyone else here managed to figure out their MN?

  • 4
    Six Degrees of Kevin Bacon? The reality is the only you can find it, because only you really know whom you know. There is no formula. – PhishMaster Dec 31 '19 at 1:59
  • 3
    It's not a formula, it requires data mining. For games in the database, someone might have done the data analytics. then all have to do is connect myself to someone in the database, either by recalling a game i've played, or by playing a game with someone already in the database. – Laska Dec 31 '19 at 4:32
  • 1
    I also have a Morphy number of at most 4. I played Leonard Barden in a simul in the early 80s (or just possibly very late 70s), then see en.wikipedia.org/wiki/Leonard_Barden#Morphy_number – Ian Bush Dec 31 '19 at 15:43
  • 1
    I suppose it should be more meaningful if it's valid only for classical chess tournament games? – A. N. Other Jan 1 at 18:58
  • 2
    An interesting sideline question should be "how many living players have Morphy number 3?". From the Wikipedia page I see only Barden, Ivkov, Kuijpers, Langeweg, Matanovic, Olafsson, Penrose and Reuben, but of course there may be a lot less known players still alive. – A. N. Other Jan 1 at 19:57
9

You'd have to find a list of players Morphy has played. Then, you'd research as many players who played each of those players. This can all be done by searching by player in a large database. Eventually you'd have a large tree, and the problem comes down to an optimal search algorithm.

You'd search "branches" with a more likely chance of giving you a small Morphy number. This means looking at players who have played more games over their career. For example, if some player A was one of Morphy's opponents who played the most games, you'd look at him first. Then, find one of Player A's opponents (call him B) who played the most games in his lifetime, and look at him first. If doing this recursively with B never leads to you (or gives a poor Morphy number), go on to C: the opponent of player A who played the second most games. If eventually you find all of Player A's opponents don't lead to you, meaning Player A isn't connected to you, go on to the opponent of Morphy who had the second most games.

But it's still a massive job to search. Even if you find a link to yourself, you need to prove/justify that it's the smallest link. Perhaps you could organize all these players into a tree and write a program to efficiently search it.

  • Thanks, inertial. I guess I am hoping that someone has already done the data mining for the database of games. It's the kind of thing some techie might have done. Then I agree there is manual effort for any casual player if they want to find a link to that database – Laska Dec 31 '19 at 4:34
  • 1
    @Laska Oh well if it's actually a thing in some circles, there's a higher chance someone has already mined. But I wouldn't know. – Inertial Ignorance Dec 31 '19 at 10:16
  • 13
    In computer science, this is a solved problem, for example, en.wikipedia.org/wiki/Dijkstra%27s_algorithm. What you describe here looks like a depth-first algorithm. There is an easy, intuitive breadth-first algorithm: Take all players directs connected to Morphy. They form set 1. Then, take the set of all players directly connected to set 1. That's set 2. You add layers of sets until you find yourself or there is no further layer. That in fact gives you all the shortest paths from Morphy to anyone. This can be computed very efficiently as well because these set operations are fast. – usr Dec 31 '19 at 11:55
  • 1
    @usr I was thinking along the lines of minimax, but Dijkstra's algorithm would work as well. I'm not sure how efficient it would be though, since with breadth-first you'd be spending time examining players who have a little chance of giving you an optimal Morphy number. With a minimax search, "move ordering" (i.e., looking at players who have played the most games first) could narrow the search space. – Inertial Ignorance Dec 31 '19 at 15:06
  • 2
    @InertialIgnorance you've got a point. With A*, you can define a useful distance heuristic so that more likely paths are searched first. Maybe base that heuristic on time or geography? With my set based method, you can precompute all answers and store them. 1 million players and 100 million games could be processed completely in a few seconds. This is not a very expensive problem. – usr Dec 31 '19 at 20:32
8

I never heard of the 'Morphy number' until I read your post. I found that my Morphy number is 5. Here is how I did it.

I started with Wikipedia

After looking at the list I realized that my best bet was the simul where I played John Donaldson. I still regret not pushing the pawn after preparing it so well...

I looked at other American players John would have played and found that he played Reshevsky at Lone Pine 1981.

Per Wikipedia Reshevksy's number is 3.

  • Technically, you found that your Morphy number is at most 5. Proving that it's not 4 (or lower) usually takes quite a bit of effort. – Arthur Jan 2 at 11:22
  • true. 5 is an upper bound. I'm also sure that my number is not zero and that I never played Morphy myself. So that gives 2 as a lower bound. 3 seems very unlikely but not sure how to rule it out. – Michael West Jan 2 at 13:25
5

I had a similar problem not long ago, though not chess related. If I were to pattern this solution off of that one, I would consider storing Morphy in an SQL table along with all of his opponents, along with all of their opponents, and so on, in a parent/child relationship. So you would have one table with two columns (id and parent_id). id would be the child of parent_id and any id could be a parent_id, child id or both. So if Morphy is parent_id=1 and he played ids 2-10, you might have

parent_id  |  id
1          |  2
1          |  3
1          |  4

etc.

2          |  25
2          |  28

etc.

The last row would be you. Perhaps you are id=1,100,000

1,000,000  |  1,100,000

Say this table is call chess_players, you could then recursively query this table to get your id and all of your ancestor parent_ids. Something like this

with recursive cte (id, name, parent_id) as
(
 select     id,
            parent_id
 from       chess_players
 where      parent_id = 1 and id=1100000 -- Morphy is the parent and you are the child
 union all
 select     p.id,
            p.parent_id
 from       chess_players p
 inner join cte
         on p.parent_id = cte.id
)
select * from cte;

You will then see all of the parent_ids of your id number all the way up to Morphy's parent_id of 1. I suppose this is your Morphy count and you could use this technique for anyone in your chess_players table.

I'm thinking you could probably scrape a database like chessgames.com to populate your table.

  • 1
    A plays B, B plays C, C plays A. Of those relationships, how do you know which ones should be the id and which should be the parent_id? – D M Dec 31 '19 at 21:26
  • That's a good question. If you think of the parent/child relationship like a tree with, say, Morphy at the root and his opponents the first level down and so on, you would want to order the parent_ids in ascending order as you progress down the branches of the tree. If you were a parent and child in the tree, your id and parent_id would be the same. – Matt Cremeens Dec 31 '19 at 21:34
  • But perhaps it doesn't matter. If you were player C, then this query in your example would return up to 2 results: one where you had a Morphy score of 2 and the other where you had a Morphy score of 3: perhaps then pick the minimum? – Matt Cremeens Dec 31 '19 at 21:44
  • If you have the relationships go multiple ways, you'd likely run into an infinite loop; you'd need some mechanism to make sure it doesn't run to infinity. – D M Dec 31 '19 at 22:11
3

As far as an algorithmic answer goes, if you can get a set of games into a pandas dataframe (Python), the following code should get you the Morphy numbers, unless I've messed up somewhere:

def get_distances(games, 
                  starting_player = 'James Morphy', 
                  max_depth = 100,
                  white_col_name = 'white'
                  black_col_name = 'black')
    player_nums = {starting_player:0}   
    games_left = pd.DataFrame(index = games.index)
    games_left[['white','black']] = games[[white_col_name, black_col_name]]
    for current_depth in range(max_depth):
        known_players = set(player_nums.keys())
        numbered_white = games_left.white.isin(known_players)
        numbered_black = games_left.black.isin(known_players)
        new_white = games_left.loc[numbered_black & (~numbered_white)]            
        new_black = games_left.loc[numbered_white & (~numbered_black)]
        new_players = set(new_white.white).union(set(new_black.black))
        if not new_players:
            return {'player_nums': player_nums, 
                    'result': 'Ran out of connections'}
        for player in new_players:
            player_nums[player] = current_depth+1
        games_left = games_left.loc[~(numbered_white | numbered_black)]
        if games_left.shape[0] == 0:
            return {'player_nums': player_nums, 
                    'result': 'Analyzed all games'}
    return {'player_nums': player_nums,  
            'result':  'Reached maximum depth'}

This gets the Morphy number for everyone. Getting just yours is "almost as hard" (for some definition of "almost as hard") as getting all the Morphy numbers. This gets the numbers for a fixed data set. If you want to update the numbers as more games are played, you can just keep rerunning the program, but there's probably some tweaks you can make to make updating more efficient. Also, there have been comments suggesting people think that calculating the Morphy number would have an exponential complexity with respect to the depth number, but as long as the number of games is fixed, this algorithm has polynomial complexity with respect to the number of games.

More information here: https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

3

Pseudocode to iteratively compute morphy number.

assume you have a database with a table plays of two columns x and y where a row indicates two indeviduals who have played one another.

_morphy = {}
def Morphy(name):

   if name == 'Morphy':
      return 0

   if name in _morphy:
      return _morphy[name]

   _morphy[name] = math.inf
   score = math.inf
   results = execute(select x, y from plays where x=name or y=name)
   for x, y in results:
      if x == name:
         score = min(score, Morphy(y) + 1)
      elif y == name:
         score = min(score, Morphy(x) + 1)

   _morphy[name] = score
   return score

print(Morphy('Jar Jar Binks'))
2

Morphy numbers are something new to me.

It is the degrees of detachment little world marvel for chess players.

I was looking Gligoric and discovered he had a Morphy number of 3.

So Morphy (1837-1884) has a Morphy number zero.

Any individual who played him has a Morphy number of 1.

Any individual who played a Morphy number 1 has a Morphy number 2, etc.

I played John Littlewood in a simul.

John Littlewood had played Botvinnik who has an MN of 3.

That gives me an MN of 5.

Anand, Kramnik, and Gelfand additionally have MNs of 5.

Little world I have just 5 degrees of partition from Morphy who was conceived in 1837.

  • Welcome to chess.Stackexchange and thanks for sharing - yes it’s a small world indeed – Laska Jan 1 at 13:04
2

This may not help if you do not have games in the ChessBase database (or even enough games), but ChessBase recently released a feature called "WinChain", which TRIES to find your "number" to any player, including Morphy. Nevertheless, I found that it still does not work particularly well for going back that far, but you still might be interested.

Here is an article called "Three Steps to Morphy" discussing the feature.

And here is a link to the page specifically for the Morphy number.

I could not get my Morphy number since my chain was still too long, but I was only four steps from Kasparov, Karpov and Carlsen, and 5 from Fischer.

enter image description here

  • Of course I'm not in that database, but I tried putting in the name of an IM that I've played, and he wasn't in there either. Then I tried putting in the name of a 2600+ rated GM that the IM had played, and he wasn't in there either! This would seem to limit the usefulness of this tool. – D M Mar 28 at 15:16
  • @DM Obviously, I did not write it, so I cannot say why that is, but I suspect it is still limited by how many steps away it is. It does seem imperfect, but it might work for someone. – PhishMaster Mar 28 at 15:19
  • I was able to do it in segments....Murphy to Alekhine, Alekhine to Kasparov, then to me. – PhishMaster Mar 28 at 15:24
  • Oh come on... the GM's first name was spelled differently, and for the IM, I apparently had to put his first name and middle initial in the first name field for it to work. They are in there after all. – D M Mar 28 at 15:30
  • 1
    New problem: It says the IM has a Morphy number of 3, but somehow I don't think the "Smith, J" that played Morphy in a simul in 1858 is the same "Smith, J" that played an internet game in 2004. – D M Mar 28 at 15:33
1

There is no magical way of finding it, of course, you just have to know the history of the people that you have played and then you can deduce your Morphy number. Of course, it is highly likely that the chain never reaches Morphy.

  • Hi Subhan and welcome to chess.stackexchange! I guess I am hoping that someone's already done the basic mining. I got lucky with my own case, but I am thinking that the branching factor is so huge. If someone has 100 lifetime opponents (gross underestimate) and there are no multiple paths (gross overestimate) then there could have been 100 MN1, 10K MN2, 1M MN3 & 100M MN4! So its the reporting of games which is the limiting factor. – Laska Dec 31 '19 at 4:30
  • 3
    "Of course, it is highly likely that the chain never reaches Morphy." - I disagree; it's highly likely that it does reach Morphy. Who'd you learn to play from? Unless the answer is "the instructions that came with my chess set", you're probably going to get to Morphy eventually. – D M Jan 1 at 0:59
  • D M, think about it in Morphy's era there were more than thousands of people who knew how to play chess so it could end up going to them. It reaching Morphy is highly unlikely. Also, how does the answer to where I learned chess from coming into this? I could learn chess from anywhere and still play the same people thus having the same chain. :) – SubhanKhan Jan 1 at 5:25
  • 3
    I beg to differ—it's highly likely that the chain will reach all of those thousands of people in Morphy's era, including Morphy himself. D M's point is that if you learned chess from a person, then you have probably played chess with that person, meaning that if that person has a Morphy number, you do, too. – Tanner Swett Jan 1 at 7:06
  • 1
    Tanner Swett, True now that I think about it. – SubhanKhan Jan 1 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.