C # demo of deep Priority Search Algorithm,
// The improved algorithm must be used in the thesis. Here, we will test it in demo.
Using System; using System. collections. generic; using System. linq; using System. text; using System. threading. tasks; namespace DFS {class Program {public int [,] map = new int [100,100]; public int [] road = new int [120]; public int n, x, y; public int m = 1; public int [] visited = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,}; static void Main (string [] args) {Program pro = new DFS. program (); int I, j; pro. n = int. parse (Console. readLine (); pro. x = int. parse (Console. readLine (); pro. y = int. parse (Console. readLine (); for (I = 0; I <pro. n; I ++) {for (j = 0; j <pro. n; j ++) {pro. map [I, j] = int. parse (Console. readLine () ;}} pro. road [0] = pro. x; pro. dfs (pro. x);} public void dfs (int p) {visited [p] = 1; int I, j; for (I = 0; I <n; I ++) {if (map [p, I] = 1 & visited [I] = 0) {if (I = y) // if the destination is found in depth, output the path {for (j = 0; j <m; j ++) {Console. writeLine ("{0}", road [j]);} Console. writeLine ("{0} \ r \ n", y);} else // if this point is not the end point {map [p, I] = 0; road [m] = I; // Save the point m ++; dfs (I); // then perform a deep search for map [p, I] = 1; visited [I] = 0; m --;}}}}}}