示例#1
0
 public void AddPath(NoteClass note, double value, bool isTwoway = false)
 {
     this.paths.Add(note, value);
     if (isTwoway)
     {
         note.paths.Add(this, value);
     }
 }
示例#2
0
 public NoteClass(string id, NoteClass note, double value, bool isTwoway = false)
 {
     this.id = id;
     this.paths.Add(note, value);
     if (isTwoway) // 双向
     {
         note.paths.Add(this, value);
     }
 }
示例#3
0
        public NoteClass GetShortestPath()
        {
            double    min         = 99999;
            NoteClass result_note = null;

            foreach (NoteClass note in this.paths.Keys)
            {
                if ((double)this.paths[note] < min)
                {
                    min         = (double)this.paths[note];
                    result_note = note;
                }
            }
            return(result_note);
        }
示例#4
0
 public static string ShortestPathAnalysis(NoteClass[] notes, NoteClass fromNote, NoteClass toNote)
 {
     return("");
 }