private void Get_Min_Time_Data(string str1, string str2) { Queue <int> Qu1 = grp1.ShortestPath_Time(str1, str2); int index; int n = Qu1.Dequeue(); int m; long time = 0; long day = 0; long end_time = 0; dataGridView1.Rows.Clear(); while (Qu1.Count > 0) { m = n; n = Qu1.Dequeue(); index = dataGridView1.Rows.Add(); dataGridView1.Rows[index].Cells[0].Value = grp1.IDToName(m); dataGridView1.Rows[index].Cells[1].Value = grp1.IDToName(n); if (end_time > grp1.Get_Go_Time(m, n)) { day++; } time = grp1.Get_Go_Time(m, n) + day * 24 * 60; end_time = grp1.Get_Trans_Time(m, n) + grp1.Get_Go_Time(m, n); dataGridView1.Rows[index].Cells[2].Value = Min_To_Time(time); time += grp1.Get_Trans_Time(m, n); dataGridView1.Rows[index].Cells[3].Value = Min_To_Time(time); dataGridView1.Rows[index].Cells[4].Value = Min_To_Time(grp1.Get_Trans_Time(m, n)); dataGridView1.Rows[index].Cells[5].Value = grp1.Get_Money(m, n) + "元"; dataGridView1.Rows[index].Cells[6].Value = grp1.Get_Road_Trans(m, n); } }