1 degree of separation. Every step below is a race both drivers started, and how they finished against each other.
Shared races only: team-mates count because they started the same race, but a chain never passes through an identity whose record contains a gap no career could span. Those are usually two people on one name, and they would otherwise weld two eras together and produce a shorter chain than really exists.