/// <summary> /// Perform bidirectional search /// </summary> private void toolStripButtonSearch_Click(object sender, EventArgs e) { // find the shortest path with bidirectional search pathes.Clear(); showResult = false; pictureBoxGraph.Invalidate(); result = agent.BidirectionalSearch(graph, graph.Index(toolStripTextBoxFrom.Text), graph.Index(toolStripTextBoxTo.Text)); toolStripTextBoxPathDistance.Text = result.Distance.ToString(); // start timer to visualize results Timer timer = new Timer(); timer.Interval = 1000; timer.Tick += new EventHandler(timer_Tick); timer.Start(); }