I wrote a program to do this and it gave me the answer of 11
static void Test()
{
int[][] numbers = new int[8][];
//numbers[1] will contain all of the points connected to point 1
//numbers[2] will contain all of the points connected to point 2
//and so on...
numbers[1] = new int[]{2, 3, 4}; // A
numbers[2] = new int[]{1, 5};
numbers[3] = new int[]{1, 5, 6};
numbers[4] = new int[]{1, 5, 6};
numbers[5] = new int[]{2, 3, 4, 7};
numbers[6] = new int[]{3, 4, 7};
numbers[7] = new int[]{5, 6}; // G
int currentSpot = 1;
bool[] visited = new bool[8];
List<int[]> sequences = new List<int[]>(); //contains a list of the previous sequences
for (int i = 0; i < 1000000; i++) //repeat 1 million times
{
Array.Clear(visited, 0, visited.Length); //make it so that no points have been visited
currentSpot = 1; //start at point 1
List<int> chain = new List<int>(); //will store all the numbers of spots that have been visited
chain.Add(1); //mark point 1 as visited
visited[1] = true;
while(true)
{
int r = random.Next(0, numbers[currentSpot].Length); //generate a random point that is linked to current point
currentSpot = numbers[currentSpot][r]; //move to a random point that is linked to current point
chain.Add(currentSpot); //add this to the chain
if (visited[currentSpot] == true) break; //if already visited point, break
visited[currentSpot] = true; //mark current point as visited
if (currentSpot == 7)
{
bool work = true;
for (int k = 0; k < sequences.Count; k++)
{
if (sequences[k].SequenceEqual(chain.ToArray())) work = false; //check if the current sequence has already been found
}
if (work)
{
// if the sequence is a new way to get to 7, then add it to the list of sequences
sequences.Add(chain.ToArray());
}
break;
}
}
}
Console.WriteLine(sequences.Count); // prints the number of unique paths found
clock.Stop();
Console.WriteLine("Solving time is " + clock.Elapsed.TotalMilliseconds + " ms");
}
One thing you might have noticed is that I completely disregarded point H and all of its connections to other points.