Question

What is the Pru ̈fer code for a simple path whose vertices are numbered in increasing...

What is the Pru ̈fer code for a simple path whose vertices are numbered in increasing
order (i.e., 1 ∼ 2 ∼ 3 ∼ · · · ∼ n)?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Given that, the vertices are numbered in increasing order from 1 to n. The sequence will be having n-2 values.

The tree with vertices from 1 to n (Ex: 1 to 5) is as shown below and the prufercode will be having (n-2)=(5-2)=3 values.

Initially, the prufer code will be empty.

PruferCode={}

Now, start with the lowest label say a. Consider 2 as the lowest label in the above tree. Find the vertices connecting it to the rest of the tree say b. In this case it is connected to 1. Now remove a from the tree and add b to prufercode.

PruferCode={1}

Now, tree becomes,

Continue the same above process, until we are left with two nodes.

Now, the lowest label is 3, and it is connected to 1. So remove 3 and add 1 to prufercode.

PruferCode={1,1}

Now, tree becomes,

Now, the lowest label is 1, and it is connected to 5. So remove 1 and add 5 to prufercode.

PruferCode={1,1,5}

Now, tree becomes,

Stop the process now, because we left with only 2 nodes.

Therefore, the prufercode will be PruferCode={1,1,5}.

Add a comment
Know the answer?
Add Answer to:
What is the Pru ̈fer code for a simple path whose vertices are numbered in increasing...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • What is the Pru ̈fer code for a simple path whose vertices are numbered in increasing...

    What is the Pru ̈fer code for a simple path whose vertices are numbered in increasing order (i.e., 1 ∼ 2 ∼ 3 ∼ · · · ∼ n)?

  • only (i) Practice Problems Problem 11.3. Which of the items below are simple-graph properties preserved under isomor phism? (a) The vertices can be numbered 1 through 7 (b) There is a cycle that inclu...

    only (i) Practice Problems Problem 11.3. Which of the items below are simple-graph properties preserved under isomor phism? (a) The vertices can be numbered 1 through 7 (b) There is a cycle that includes all the vertices. (c) There are two degree 8 vertices (d) Two edges are of equal length. (e) No matter which edge is removed, there is a path between any two vertices (10) There are two cycles that do not share any vertices (g) One vertex...

  • Answer each question in the space provided below. 1. Draw a simple graph with 6 vertices...

    Answer each question in the space provided below. 1. Draw a simple graph with 6 vertices and 10 edges that has an Euler circuit. Demonstrate the Euler circuit by listing in order the vertices on it. 2. For what pairs (m,n) does the complete bipartite graph, Km,n contain an Euler circuit? Justify your answer. (Hint: If you aren't sure, start by drawing several eramples) 3. For which values of n does the complete graph on n vertices, Kn, contain a...

  • 2. (Graphs, degree sequence) If G is a simple graph with n vertices, then the degree...

    2. (Graphs, degree sequence) If G is a simple graph with n vertices, then the degree sequence of G is a list a1, a2, a3, . . . , an of the degrees of all of the vertices of G in decreasing order. For instance, the degree sequence of the graph G drawn here is 3, 2, 2, 2, 2, 2, 1, 0. (a) Sketch a graph with the degree sequence 4, 3, 2, 2, 2, 1, and a graph...

  • (Problem R-14.16, page 678 of the text) Let G be a graph whose vertices are the...

    (Problem R-14.16, page 678 of the text) Let G be a graph whose vertices are the integers 1 through 8, and let the adjacent vertices of each vertex be given by the table below: Vertex                             adjacent vertices      1                                         (2,3,4)      2                                         (1,3,4)      3                                         (1,2,4)      4                                         (1,2,3,6)      5                                         (6,7,8)      6                                         (4,5,7)      7                                         (5,6,8)      8                                         (5,7) Assume that, in a traversal of G, the adjacent vertices...

  • Code in Python Problem 1 (2 Points) 1. Write a function randomWalk(.. .) which simulates one path (or trajectory) of a s...

    Code in Python Problem 1 (2 Points) 1. Write a function randomWalk(.. .) which simulates one path (or trajectory) of a simple symmetric random walk with 2N time steps (i.e. from 0,1,2,...,2N) starting at So-0 nput: lengthofRandomWalk2N Output: samplePath: Array of length 2N+1 with the entire path of the random walk on 0,1,2,..,2N In def randomwalk(lengthofRandomwalk): ## WRITE YOUR OWN CODE HERE # HINT: USE np. random . choice ( ) TO SIMULATE THE INCREMENTS return samplePath In [ ]:...

  • (a) Classify all simple graphs G on n vertices such that γ(G)-1. [1] (b) Classify all...

    (a) Classify all simple graphs G on n vertices such that γ(G)-1. [1] (b) Classify all simple graphs G on n vertices such that β(G)-1. [1] (c) For positive integers m and n, with m2 n, find, in terms of m and n, the values of γ(G) and β(G) when G is the complete bipartite 2 0 graph Kmn

  • Input a simple undirected weighted graph G with non-negative edge weights (represented by w), and a...

    Input a simple undirected weighted graph G with non-negative edge weights (represented by w), and a source node v of G. Output: TDB. D: a vector indexed by the vertices of G. Q: priority queue containing the vertices of G using D[] as key D[v]=0; for (all vertex ut-v) [D[u]-infinity:) while not Q. empty() 11 Q is not empty fu - Q.removein(); // retrieve a vertex of Q with min D value for (all vertex : adjacent to u such...

  • Packets in Ethermet LANs are routed according to the uni que path in a tree whose...

    Packets in Ethermet LANs are routed according to the uni que path in a tree whose vertices correspond to clients and edges correspond to physical connections between the clients. In this problem, we want to design an algorithm for finding the "worst-case route, i.e., the two clients that are furthest apart. Let Tbe a tree, where each edge is labeled with distance 1 Figure (2a) Figure (2b) Define the diam eter of Tto be the length of a longest path...

  • 3. The pair of random variables X and Y is uniformly distributed on the interior of the triangle with the vertices whose coordinates are (0,0), (0,2), and (2,0) (i.e., the joint density is equal to a...

    3. The pair of random variables X and Y is uniformly distributed on the interior of the triangle with the vertices whose coordinates are (0,0), (0,2), and (2,0) (i.e., the joint density is equal to a constant inside the triangle and zero outside). (a) (10 points) Find P(Y+X< 1). (b) (10 points) Find P(X = Y). (c) (10 points) Find P(Y > 1X = 1/2). 3. The pair of random variables X and Y is uniformly distributed on the interior...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT