public void AddPath(NoteClass note, double value, bool isTwoway = false) { this.paths.Add(note, value); if (isTwoway) { note.paths.Add(this, value); } }
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); } }
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); }
public static string ShortestPathAnalysis(NoteClass[] notes, NoteClass fromNote, NoteClass toNote) { return(""); }