Some more graph algorithms translated to C#