Question: Write a program that lets the user create a weighted graph dynamically. The user can create a vertex by entering its name and location, as
Write a program that lets the user create a weighted graph dynamically. The user can create a vertex by entering its name and location, as shown in Figure 29.28. The user can also create an edge to connect two vertices. To simplify the program, assume that vertex names are the same as those of vertex indices. You have to add the vertex indices 0, 1, . . ., and n, in this order. The edges in the MST are displayed in red. As new edges are added, the MST is redisplayed.
67.0 1 $7.0 12:0 Add a new vertex Add a new edge Vertex u (index): 1 Vertex name: Vertex v (index): 2 x-wordnate: 30 y coordinate: 130 Wcight: 12 Add Vertex Add Edge Start ver (dear Graphs)
Step by Step Solution
3.46 Rating (169 Votes )
There are 3 Steps involved in it
Program Plan Create a class DisplayDynamicMST that extends Application class Create three text field one for insertion of vertex name second for x coordinate and third for y coordinate Create one Add ... View full answer
Get step-by-step solutions from verified subject matter experts
