コード例 #1
0
        private void AjouterChildNode(TreeNodeCollection arbre, Parti02.Point O)
        {
            int i = 0;

            foreach (Parti02.Point p in dij.Ferme)
            {
                if (p != dij.Premier)
                {
                    if (p.Origine == O)
                    {
                        arbre.Add(p.Nom + ":" + p.DistParcourue);
                        AjouterChildNode(arbre[i].Nodes, p);
                        i++;
                    }
                }
            }
        }
コード例 #2
0
        public QDijkstra()
        {
            InitializeComponent();
            Parti02.Point A = new Parti02.Point("A");
            Parti02.Point B = new Parti02.Point("B");
            Parti02.Point C = new Parti02.Point("C");
            Parti02.Point D = new Parti02.Point("D");
            Parti02.Point E = new Parti02.Point("E");
            Parti02.Point F = new Parti02.Point("F");
            Parti02.Point G = new Parti02.Point("G");
            dij         = new Dijkstra("A", "F");
            nbrDijkstra = dij.Nombre;
            foreach (Parti02.Point p in dij.Graphe)
            {
                checkedListBoxO.Items.Add(p.Nom);
                checkedListBoxF.Items.Add(p.Nom);
            }

            userOuverts.Add(A);
            listBoxUpdate();
            ajoutArbre();
            InitArbreJuste();
        }