示例#1
0
 internal Tour(AbstractGraph <TVertex, TCost> graph, int[] permutation, bool circular = true)
 {
     m_circular     = circular;
     m_graph        = graph;
     m_permutation  = permutation;
     m_2optImproved = circular ? false : true;
 }
            internal Tree(AbstractGraph <TVertex, TCost> graph)
            {
                m_graph = graph;
                m_edges = new List <Tup <int, int> >(m_graph.m_nodes.Count);

                for (int i = 0; i < m_graph.m_nodes.Count; i++)
                {
                    m_edges.Add(new Tup <int, int>(-1, -1));
                }

                m_visited   = new bool[m_graph.m_nodes.Count].SetByIndex(i => false);
                m_edgeCount = 0;
            }
示例#3
0
            internal Edge(AbstractGraph <TVertex, TCost> graph, int i0, int i1)
            {
                if (i0 == i1)
                {
                    throw new ArgumentException("Degenerated Edges are not posible");
                }
                m_graph = graph;

                if (i0 < i1)
                {
                    Index0 = i0; Index1 = i1;
                }
                else
                {
                    Index0 = i1; Index1 = i0;
                }
            }
示例#4
0
 internal Vertex(AbstractGraph <TVertex, TCost> graph, int index)
 {
     m_graph = graph;
     m_index = index;
 }