1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mkey [24]
4 years ago
12

You are an interior decorator, confronted with a dark living room. To lighten the room up, you have n candles and want to build

k trees of candles. First, the candles {1, . . . , k} are already put on the floor, to serve as roots of the k trees. You would like to put the remaining n − k candles {k + 1, . . . , n} on top of them to form k trees {T1, · · · , Tk} of candles, where each Ti is rooted at candle i. You can put an arbitrary number of candles on top of the same candle. The cost to putting candle i on top of candle j is C(i, j). We assume that C(i, j) ≥ 0 and C(i, j) = C(j, i)) for i 6= j. No candle can be reused or put on top of itself. You cannot use the candles {1, . . . , k} anymore, as they have already been fixed to the floor.(a) Describe an algorithm to find a solution of minimum cost. (b) Prove the correctness of your algorithm. (c) Give a runtime analysis of your algorithm in the previous part.
Computers and Technology
1 answer:
user100 [1]4 years ago
6 0

Answer:

a)

Algorithm to find a solution of min. cost

Function:cost(Graph G,Graph G1);

GC --> empty graph

for i in edges E:

if E(i,j) in G:

c(i,j)=c(i,j)

else if E(i,j) in G1:

c(i,j)=-c(i,j)

Function:Mincost(Graph G):

GC=Cost(G,G1)

while(negativecycle(GC)):

Update residal graph(G1)

GC=Cost(G,G1)

mincost=sum of Cij*F(i,j)

return mincost;

Explanation:

a)

1) Start the program

2) Read the no. of edges and vertices and also read the cost of the two nodes.

3) Find the min cost by travelling to the destination i.e.. finding all possible min. cost values.

4) Compare the all possible min.cost values

5) And display the least min. cost

6) Stop the program

b)

<u>Correctness of algorithm</u>

1)Here in these algorithm we are calculating all the possible cases.

2)These algorithm also supports the negative cost.

3)These algorithm occupies more space.

4)Takes less time

5)so,these algorithm provides the cost efficient solution very effectively.

c)

<u>Run Time Analysis</u>

1) While reading the values during the run time the program execution will stop until user provides the values.

2) Based on the User input Output vary.

3) Time consumption and space consumption is depends on the no. of inputs the user is given.

You might be interested in
___operating space means there is a restriction to the drivers line of sight
Harman [31]

Answer

Closed zone operating space means there is a restriction to the drivers line of sight

Explanation

The line of sight restriction to a driver or while driving is the visible path of travel from your vehicle to your targeted area towards your destination.It is also the area that's visible to a driver while driving.

Closed zone or condition means that there is a restriction to the drivers view or that the space is unavailable in a particular zone.

5 0
3 years ago
Which OS does NOT provide users with a GUI?
vesna_86 [32]
The answer is C ms-dos
Side note:
GUI means graphical user interface. In other words, that means it looks pretty and has cool buttons, animations and cute stuff. MS-DOS is just a black screen with words on it. Definitely not cute or cool.
3 0
4 years ago
Which of the following cannot be copyrighted
denpristay [2]
1.I'm not sure.
<span>2. A story that you wrote based on a book you read
3. T</span><span>he website user (I think)</span>
4 0
4 years ago
In the RGB model, which color is formed by combining the constituent colors?
iogann1982 [59]
If you combine maximum values of Red Green and Blue you will get white.
4 0
3 years ago
Read 2 more answers
25) _____ involves assigning numbers or other symbols to answers so that the responses can be grouped into a limited number of c
Hitman42 [59]
B- The answer is "Data entry".
5 0
3 years ago
Other questions:
  • How do i connect wifi direct from pc to phone​
    15·1 answer
  • DPI stands for _____.
    14·1 answer
  • Which group on the Home Ribbon contains the line spacing attribute?
    9·2 answers
  • A ______ allows a hacker to gain access to your computer and take almost complete control of it without your knowledge.
    12·2 answers
  • What the heck is a motherboard and why is my computer not working when i take it out
    14·1 answer
  • What keyboard functions lets you delete words
    9·2 answers
  • Difference between server and a client computer
    7·1 answer
  • What are some ways to rename a worksheet? Check all that apply.
    9·1 answer
  • What is netiquettes?. Mention any 4 netiquettes. (for class 6)​
    5·1 answer
  • "last month, our sales rose when we increased prices by 15%, so we should raise our prices another 15% this month." which logica
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!