Пример #1
0
 public GraphViewModel(Graph graph1, Graph graph2, ObservableCollection <int> condition, Graph isomorphic)
 {
     m_Graph1     = graph1;
     m_Graph2     = graph2;
     m_Isomorphic = isomorphic;
     m_Condition  = condition;
     m_Graph1.GenerateDotFile();
     m_Graph2.GenerateDotFile();
     m_Graph1.GeneratePngFile();
     m_Graph2.GeneratePngFile();
     //m_Isomorphic.m_Name = @"C:\graphviz-2.32\release\bin\m_isomorphic";
 }
Пример #2
0
 public GraphViewModel(Graph graph1, Graph graph2, ObservableCollection<int> condition, Graph isomorphic)
 {
     m_Graph1 = graph1;
     m_Graph2 = graph2;
     m_Isomorphic = isomorphic;
     m_Condition = condition;
     m_Graph1.GenerateDotFile();
     m_Graph2.GenerateDotFile();
     m_Graph1.GeneratePngFile();
     m_Graph2.GeneratePngFile();
     //m_Isomorphic.m_Name = @"C:\graphviz-2.32\release\bin\m_isomorphic";
 }
Пример #3
0
        public void GenerateIsomorphic()
        {
            int random;

            m_ConditionIsomorphic.Clear();
            for (int i = 0; i < m_Condition.Count; i++)
            {
                for (int j = 0; j < m_Condition.Count; j++)
                {
                    m_Isomorphic.m_Matrix[i, j] = false;
                }
            }
            for (int i = 0; i < (m_Condition.Count - 1); i++)
            {
                random = m_Random.Next((m_Condition.Count - 1));

                if (!(m_ConditionIsomorphic.Contains(random)))
                {
                    m_ConditionIsomorphic.Add(random);
                }
                else
                {
                    i--;
                }
            }
            for (int i = 0; i < m_Condition.Count; i++)
            {
                if (!(m_ConditionIsomorphic.Contains(i)))
                {
                    m_ConditionIsomorphic.Add(i);
                }
            }
            for (int i = 0; i < m_ConditionIsomorphic.Count; i++)
            {
                for (int j = 0; j < m_ConditionIsomorphic.Count; j++)
                {
                    if (m_Graph1.m_Matrix[m_ConditionIsomorphic[i], j] == true)
                    {
                        for (int k = 0; k < m_ConditionIsomorphic.Count; k++)
                        {
                            if (m_ConditionIsomorphic[k] == j)
                            {
                                m_Isomorphic.m_Matrix[i, k] = true;
                            }
                        }
                    }
                }
            }
            m_Isomorphic.GenerateDotFile();
            m_Isomorphic.GeneratePngFile();
        }