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]
3 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]3 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
Write a program that asks the user to enter a number of seconds and then printsthe same amount of time in days, hours, minutes,
MariettaO [177]

Answer:3363 seconds

Explanation:3363 is equivalent to 0days 1 hour, 1 min, and 7 sec

8 0
3 years ago
The true or false questions.<br><br> 1.egrep can accept multiple filenames as input arguments.
BlackZzzverrR [31]

Answer: True  

Explanation: yes, it is true that egrep can accept multiple filenames as input arguments for example egrep -r "text1/text2", so this will search in all the sub directories . E grep is also known as 'grep -E' which belongs to the group of grep function and we used egrep to separate multiple patterns for OR conditions. This is also very less time consuming if you are going to search multiple input arguments in multiple different logs at the same time.

5 0
3 years ago
"The correct syntax for passing an array as an argument to a method when a method is called and an array is passed to it is: "
Monica [59]

Question:

"The correct syntax for passing an array as an argument to a method when a method is called and an array is passed to it is: "

A) a[0]..a[a.length]

B) a()

C) a

D) a[]  

Answer:

The correct answer is A.

An example is given in the attachment.

Cheers!

4 0
2 years ago
What kind of computer system you recommend?
In-s [12.5K]
Depends on your budget and usage.
If no/low budget and happy with speed of current computer - replace network card or get an USB network card to resolve no wifi signal issue.
If no problem with budget - get a brand new latest computer.

Remember, it’s your data in the computer that worth a lot,computer hardware doesn’t cost that much and can be easily replaced.
7 0
3 years ago
1) Design a class named Axolotl that holds attributes for an axolotl's name, weight, and color. Include methods to set and get e
crimeas [40]

what subject is this exactly?

5 0
2 years ago
Other questions:
  • #TODO: Define a data structure to keep track of which links are part of / not part of the spanning tree.
    14·1 answer
  • you are the manager of a virtual team that is working on a project. You uploaded a Word document to an OneDrive account that you
    9·1 answer
  • Describe the relative benefits of routing over a broadcast style of communication. Is routed traffic more secure than broadcasti
    14·1 answer
  • Which two standards below represent newer versions of stp??
    13·1 answer
  • Wired network are the most reliable and provide the highest speed?
    7·1 answer
  • What is computer assisted translation​
    9·1 answer
  • Select the correct answer from each drop-down menu.
    6·1 answer
  • What is a distinguishing feature of 5G mmWave
    13·1 answer
  • 3.5 Lesson practice quiz: Edhesive Question 5
    8·1 answer
  • Computer science student jones has been assigned a project on how to set up sniffer. What just he keep in mind as part of the pr
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!