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
To download your presentation as pictures, choose this option.
VARVARA [1.3K]

Answer:

Download as Images

Explanation:

Copy is unspecified

Images is a synonym of pictures

PDF is a file type

ODP is a presentation file

8 0
3 years ago
Read 2 more answers
Which agency motors the sale and registration of vehicles and vessels within the state
gogolik [260]

An agency which monitors the sale and registration of vehicles and vessels within the state is the department of highway safety and motor vehicles.

<h3>What is the department of highway safety and motor vehicles?</h3>

The department of highway safety and motor vehicles can be defined as a cabinet agency that is established and saddled with the responsibility of monitoring the sales and registration of automobile vehicles and vessels within the state of Florida in the United States of America.

In 1969, the defunct department of public safety and the department of motor vehicles were merged together under Governor Claude Kirk, as a single agency, which became known as the department of highway safety and motor vehicles

Read more on department of highway safety here: brainly.com/question/4805408

#SPJ1

Complete Question:

Which agency monitors the sale and registration of vehicles and vessels within the state?

6 0
1 year ago
What's a computers C hard drive
telo118 [61]
The C hard drive is the central internal hard drive in a computer it is the hard drive that comes inside the computer when you buy it and is non-removable
7 0
4 years ago
Read 2 more answers
What is Nintendo's uniqueness?​
docker41 [41]
It’s unique because it comes with 2 screens well dependents which Nintendo
7 0
4 years ago
Read 2 more answers
Explain with example how does delay marriage help for population management​
nikdorinn [45]

Answer:

Explanation:

The population in western richer countries is decreasing but the population in some poorer developing countries is increasing and normally in the poorer communities where education is minimal or not encouraged then men and women tend to get married young and have many children. Population management is not necessary because when men and women are educated and have good standard of living with a good social system of caring for the old then married couples will tend to have one or two kids or none at all. Population control was practised by PrC and it managed to alleviate 60% of the people out if poverty and reduced the population by implementing one child policy. Now China has more male than female creating social problems of finding a wife. In the West with good social system to care for the elderly more couples are not having children. In the west where living conditions and educational level are better the Caucasian race is not having that many children as the other races in developing countries. Education and financial independence of women will encourage married women to have one or two kids so that they can still pursue their career after marriage. With modern contraception you can delay having children until you are ready for them. The concept of delaying marriage to reduce population does not hold true. However the whites’ population is decreasing every year as compared to the other non white races. The reason is that in the poorer non white countries the population is higher because of subservient position of the women who have no say in birth control

8 0
4 years ago
Other questions:
  • Consider the binary search tree constructed for the words oenology, phrenology, campanology, ornithology, ichthyology, limnology
    14·1 answer
  • 7. Glaciers have two types of deposition. Define them below:
    6·1 answer
  • What is the top folder of the file tree called
    5·2 answers
  • String member function compare compares two strings (or substrings) and returns 0 if:
    5·1 answer
  • C. Compare Mainframe and Minicomputers with their key features<br><br><br><br>plzzz help ​
    12·1 answer
  • When is the greatest risk of damage from electrostatic discharge?
    7·2 answers
  • Write code which takes a user input of a String and an integer. The code should print each letter of the String the number of ti
    12·1 answer
  • Select the correct answer.
    15·1 answer
  • 1.1 give five (5) reasons why modeling is an important part of system analysis and design
    9·1 answer
  • All of the salespeople in hyperactive media sales use laptops, so that they can take their applications and data on the road to
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!