using System.Collections.Generic;
public static void Main()
var G = new Dictionary<string, string[]>();
G.Add("A", new string[] {"B", "C"} );
G.Add("B", new string[] {"A", "D", "E"} );
G.Add("C", new string[] {"A", "E"} );
G.Add("G", new string[] {"H", "I"});
G.Add("H", new string[] {"G", "I"});
G.Add("I", new string[] {"H", "G"});
G.Add("D", new string[] {"B", "E"} );
G.Add("E", new string[] {"B", "C"} );
Console.WriteLine(G.Count);
Console.WriteLine("Run BFS, starting with C");
Console.WriteLine("Run BFS, starting with H");
public static void BFS(Dictionary<string, string[]> g, string s)
var Q = new Queue<string>();
var explored = new Dictionary<string, bool>();
foreach (string key in keys) {
Console.WriteLine("found " + s);
foreach (string w in g[v])
Console.WriteLine("found " + w);