Search code examples
algorithmgraph-theorygraph-algorithm

Six degree of separation with Ken Thompson


I am currently working on a project where I need to implement the Six Degree of Separation with Ken Thompson, who created the UNIX operating system with his colleague Dennis Ritchie. I will want to ask, what criteria is better to choose for the graph? Like in Six Degree of Kevin Bacon, the artist that we choose is the artists that had starred in the movie with him. How about for Six Degree of Ken Thompson, should I use that has relation with him?

And also, is Dijkstra's shortest path a better way to solve this? Or Depth First Search a better way?


Solution

  • Not Depth First, but Breadth-First Search (BFS) is perhaps the most effective method to determine "inner circle" of some person.

    If you want to reveal at most six levels of separation for two known persons, you also can try bi-directional BFS

    Question about "who has relation" to Ken Thompson is quite philosophical... You need to define conditions yourself - perhaps you can reveal pupils in the same school, students and instructors in the same university, relatives, colleagues, all the UNIX users and C programmists ;), ... perhaps no.