Anyway I think it's great that they have a hybrid codebase. With projects like HipHop and this Haskell backend it looks like they are gradually moving away from PHP as their main language.
[1]: http://cufp.galois.com/2009/abstracts.html#ChristopherPiroEu... [2]: https://github.com/facebook/lex-pass/tree/master
The only efficient way to implement an undirected graph is as a directed graph with doubled edges.
You want to list friends of Alice. Directed: query all friend(Alice, X). Undirected: query all friend(Alice, X) OR friend(X, Alice). Finding all friend(X, Alice) will be very slow without an index of all friend relationships with Alice in the second position. Storing this is harder than just storing friend(Alice, X) and friend(X, Alice).