public void FermerPoint(Point pt)
 {
     Ferme.Add(pt);
     Ouvert.Remove(pt);
 }
        public int Rechercher()
        {
            int dist = 0;

            Ouvert.Add(Premier);
            Premier.DistParcourue = 0;

            while (!EstPresentDansListe(Dernier, Ferme))
            {
                Console.WriteLine("O = [" + Afficher(Ouvert) + "]");
                Console.WriteLine("F = [" + Afficher(Ferme) + "]");

                ListeO.Add(Afficher(Ouvert));
                ListeF.Add(Afficher(Ferme));

                Point ptChoisi = Ouvert[0];

                int plusPetitChemin = ptChoisi.DistParcourue;
                //Selection du point avec la plus petite distance par rapport au début
                if (ptChoisi != Premier)
                {
                    for (int i = 0; i < Ouvert.Count(); i++)
                    {
                        if (Ouvert[i].CulDeSac)
                        //On enlève les points cul de sac
                        {
                            FermerPoint(Ouvert[i]);
                        }
                        else
                        // On cherche le point avec le poids le moins fort
                        {
                            if (Ouvert[i].DistParcourue < plusPetitChemin)
                            {
                                plusPetitChemin = Ouvert[i].DistParcourue;
                                ptChoisi        = Ouvert[i];
                            }
                        }
                    }
                }

                FermerPoint(ptChoisi);
                // On verifie que le point n'est pas en double
                Point pointDouble = new Point("");
                int   d           = 0;


                foreach (Point pt in Ouvert)
                {
                    if (ptChoisi == pt)
                    {
                        pointDouble = pt;
                        d++;
                    }
                }
                if (pointDouble.Nom != "")
                {
                    for (int k = 0; k < d; k++)
                    {
                        Ouvert.Remove(pointDouble);
                    }
                }

                CheminPlusCourt.Add(ptChoisi);
                //Console.WriteLine("===>Point choisi : "+ptChoisi.Nom+" ---- Points fils :  " + Afficher(ptChoisi.PA) );
                //On compare les points fermés et des points fils de ptChoisi pour les retirer des possibilités.

                foreach (Point pt in ptChoisi.PA)
                {
                    // Console.WriteLine("Point fils : " + pt.Nom);
                    pt.APourOrigine(ptChoisi);
                    Ouvert.Add(pt);

                    //Console.WriteLine("Point Père : " + pt.Origine.Nom + " -- Distance : " + pt.DistParcourue);
                    //Console.WriteLine("Points fils du points fils : " + Afficher(pt.PA));
                }
                dist++;
            }
            Console.WriteLine("O = [" + Afficher(Ouvert) + "]");
            Console.WriteLine("F = [" + Afficher(Ferme) + "]");
            Console.WriteLine("Chemin le plus court : " + Afficher(CheminPlusCourt));
            return(dist);
        }