public bool TryGetValue(bool[,] key, out Type?value)
 {
     return(dictionary.TryGetValue(
                Graph_Functions.Transform_Bool_Matrix_To_Int_Array(
                    Graph_Functions.Transform_From_Any_Isomorphism_To_Single_Same_Isomorphism(key)),
                out value));
 }
        public static void Test_3(input_test_3 A1, out output_test_3 B1)
        {
            int number_of_nodes;

            B1 = new output_test_3(A1.number_of_increasments);
            Stopwatch S = new Stopwatch();

            S.Start();
            Random r = new Random();
            int    i1, i2;

            for (i1 = 0; i1 < A1.number_of_increasments; i1++)
            {
                number_of_nodes        = A1.starting_number_of_nodes + A1.incresement_of_nodes * i1;
                B1.number_of_nodes[i1] = number_of_nodes;
                for (i2 = 0; i2 < A1.repeatings_for_each_case; i2++)
                {
                    bool[,] F_1_Adjancy_Matrix = Class2.Create_Random_Adjancy_Matrix(number_of_nodes, r);
                    bool[,] F_2_Adjancy_Matrix;
                    if (A1.are_isomorphic)
                    {
                        F_2_Adjancy_Matrix = Class2.Permute(F_1_Adjancy_Matrix, r);
                    }
                    else
                    {
                        F_2_Adjancy_Matrix = Class2.Create_Random_Adjancy_Matrix(number_of_nodes, r);
                    }
                    S.Restart();
                    bool result = Graph_Functions.Graph_Isomorphism(Graph_Functions.To_Adjency_Lists_From_Adjency_Matrix(F_1_Adjancy_Matrix), Graph_Functions.To_Adjency_Lists_From_Adjency_Matrix(F_2_Adjancy_Matrix));
                    long time   = S.ElapsedMilliseconds;
                    B1.average_times[i1] += (double)time;
                }
                B1.average_times[i1] /= A1.repeatings_for_each_case;
            }
        }
 public void Add(bool[,] key, Type value)
 {
     dictionary.Add(
         Graph_Functions.Transform_Bool_Matrix_To_Int_Array(
             Graph_Functions.Transform_From_Any_Isomorphism_To_Single_Same_Isomorphism(key))
         , value);
 }
        public static void Test_6()
        {
            Random r = new Random();

            bool[,] z = Class2.Create_Random_Adjancy_Matrix(100, r);
            int[] b1 = Graph_Functions.Transform_Bool_Matrix_To_Int_Array(z);
            bool[,] v1 = Graph_Functions.Transform_Int_Array_To_Bool_Matrix(b1);
            Console.WriteLine("Test_6       Result:" + Graph_Functions.Are_Identical_Matrixes(z, v1));
        }
 public Type this[bool[,] key]
 {
     get
     {
         return(dictionary[
                    Graph_Functions.Transform_Bool_Matrix_To_Int_Array(
                        Graph_Functions.Transform_From_Any_Isomorphism_To_Single_Same_Isomorphism(key))]);
     }
     set
     {
         dictionary[
             Graph_Functions.Transform_Bool_Matrix_To_Int_Array(
                 Graph_Functions.Transform_From_Any_Isomorphism_To_Single_Same_Isomorphism(key))] = value;
     }
 }
        public static void Test_2_NOT_isomorphic_samples(int n)
        {
            Random    r  = new Random();
            Stopwatch t1 = new Stopwatch();

            bool[,] F_1_Adjancy_Matrix = Class2.Create_Random_Adjancy_Matrix(n, r);
            bool[,] F_2_Adjancy_Matrix = Class2.Create_Random_Adjancy_Matrix(n, r);
            t1.Start();
            bool is_isomorphic = Graph_Functions.Graph_Isomorphism(Graph_Functions.To_Adjency_Lists_From_Adjency_Matrix(F_1_Adjancy_Matrix), Graph_Functions.To_Adjency_Lists_From_Adjency_Matrix(F_2_Adjancy_Matrix));
            long time          = t1.ElapsedMilliseconds;

            Console.WriteLine(
                "\n\nNot isomorphic samples"
                + "\nnumber of nodes:" + n.ToString().PadLeft(10)
                + "\ntime in miliseconds:" + time.ToString().PadLeft(10));
            Console.WriteLine("///  " + !is_isomorphic);
        }
        public static void Test_8()
        {
            Random r = new Random();

            bool[,] Z1 = Class2.F1(8, 20);
            bool[,] a1;
            bool[,] a2;
            bool[,] b1;
            bool[,] b2;
            bool c1;

            a1 = Class2.Permute(Z1, r);
            a2 = Class2.Permute(Z1, r);
            b1 = Graph_Functions.Transform_From_Any_Isomorphism_To_Single_Same_Isomorphism(a1);
            b2 = Graph_Functions.Transform_From_Any_Isomorphism_To_Single_Same_Isomorphism(a2);
            c1 = Graph_Functions.Are_Identical_Matrixes(b1, b2);
            Console.WriteLine("Test_8       Rasult:" + c1);
        }
        public static void Test_7()
        {
            Random    r  = new Random();
            Stopwatch t1 = new Stopwatch();

            bool[,] F_1_Adjancy_Matrix;
            F_1_Adjancy_Matrix         = Class2.F1(5, 50);
            bool[,] F_2_Adjancy_Matrix = Class2.Permute(F_1_Adjancy_Matrix, r);
            t1.Start();
            bool is_isomorphic = Graph_Functions.Graph_Isomorphism(
                Graph_Functions.To_Adjency_Lists_From_Adjency_Matrix(F_1_Adjancy_Matrix),
                Graph_Functions.To_Adjency_Lists_From_Adjency_Matrix(F_2_Adjancy_Matrix));
            long time = t1.ElapsedMilliseconds;

            Console.WriteLine(
                "\n\nTest_7"
                + "\ntime in miliseconds:" + time.ToString().PadLeft(10));
            Console.WriteLine("///  " + is_isomorphic);
        }
        public static void Test_4()
        {
            Random r  = new Random();
            int    n1 = 100;

            bool[,] Z1 = Class2.Create_Random_Adjancy_Matrix(n1, r);
            bool[,] a1;
            bool[,] a2;
            bool[,] b1;
            bool[,] b2;
            bool c1;

            a1 = Class2.Permute(Z1, r);
            a2 = Class2.Permute(Z1, r);
            b1 = Graph_Functions.Transform_From_Any_Isomorphism_To_Single_Same_Isomorphism(a1);
            b2 = Graph_Functions.Transform_From_Any_Isomorphism_To_Single_Same_Isomorphism(a2);
            c1 = Compare_Matrices(b1, b2);
            Console.WriteLine("Test_4       Rasult:" + c1);
        }
        public static void Test_1_isomorphic_samples()
        {
            Random    r  = new Random();
            Stopwatch t1 = new Stopwatch();

            bool[,] F_1_Adjancy_Matrix;
            F_1_Adjancy_Matrix         = Class2.F1(10, 200);
            bool[,] F_2_Adjancy_Matrix = Class2.Permute(F_1_Adjancy_Matrix, r);
            t1.Start();
            bool is_isomorphic = Graph_Functions.Graph_Isomorphism_V2(
                F_1_Adjancy_Matrix,
                F_2_Adjancy_Matrix);
            long time = t1.ElapsedMilliseconds;

            Console.WriteLine(
                "\n\nisomorphic samples"
                + "\nnumber of nodes:" + F_1_Adjancy_Matrix.GetLength(0).ToString().PadLeft(10)
                + "\ntime in miliseconds:" + time.ToString().PadLeft(10));
            Console.WriteLine("is isomorpfic:  " + is_isomorphic);
        }
 public bool Remove(bool[,] key)
 {
     return(dictionary.Remove(Graph_Functions.Transform_Bool_Matrix_To_Int_Array(
                                  Graph_Functions.Transform_From_Any_Isomorphism_To_Single_Same_Isomorphism(key))));
 }