Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Suppose we have a set of N agents and a set of N tasks.Each agent can only perform exactly one task and there is a cost associated with each assignment. We would like to find out an assignment which results in the least total cost. Your task is to write a c++ program to implement the branch and bound algorithm to solve this assignment problem.

Your program should read input data from a input file named "infile.txt". The format for the input file is as follows: First line is an integer N representing the number of agents and the number of jobs. In the next N lines, each line j (1 ≤ j ≤ N) consists of N integers representing the cost of assigning agent j to each of the N tasks.

Figure 1 gives you an example of the input format. For example, the cost of assigning agent 1 to task 1, 2, 3 and 4 are 11, 12, 18 and 40 respectively.

4

11 12 18 40

14 15 13 22

11 17 19 23

17 14 20 28

Figure 1

Total cost: 61
(1,1)
(2,3)
(3,4)
 (4,2)

Figure 2

Output, to standard output, will consist of:

  • Total cost of the assignment
  • In the next N lines, each line j (1 ≤ j ≤ N) shows the task assignment for agent j in the format "(j,k)", which means agent j is assigned to task k.

Figure 2 gives you an example of the output screen for the input file in Figure 1.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9524352

Have any Question?


Related Questions in Computer Engineering

Assignment - confidential organizational information and

Assignment - Confidential Organizational Information and Employee Responsibility As an employee, you are often required to sign confidentiality agreements when beginning work at a new company. You may also be required to ...

Question a swimmer is an athlete any athlete who

Question : A swimmer is an athlete. Any athlete, who participatedin the 2016 Summer Olympics and won a gold medal, was joyful. Any athlete, who is the world top athlete or a selected well-trained athlete, participatedin ...

Should we be renegotiating nafta yes or no if it is

Should we be renegotiating NAFTA? yes or no? If it is renegotiated, should it be replaced? What reasons would make it better in your point of view? What is the best argument you can make why NAFTA should or should not be ...

Suppose you roll a standard 6-sided die if you roll a 1 1

Suppose you roll a standard 6-sided die. If you roll a 1 (1), you randomly select one chip from a bowl containing 2 red (R) and 3 white (W) chips. If you don't roll a 1 (1 c ), you randomly select 1 chip from a bowl cont ...

Terry amp sons makes bearings for autos the production

Terry & Sons makes bearings for autos. The production system involves two independent processing machines so that each bearing passes through these two processes. The probability that the first processing machine is not ...

Explain data information and knowledge with examples make

Explain data, information, and knowledge with examples. Make sure to clearly identify the differences between the terms.

Question suppose you wanted to implement a new routing

Question : Suppose you wanted to implement a new routing protocol in the SDN control plane. At which layer would you implement that protocol? Explain. The response must be typed, single spaced, must be in times new roman ...

A chest has 3 drawers d1 has two silver coins s d2 has one

A chest has 3 drawers: (D 1 ) has two silver coins (S), (D 2 ) has one silver (S) and one gold (G), and (D 3 ) has two gold (G) coins. The drawer and coin were both randomly selected. Use the law of total probability to ...

Questionimplement a calculator for a client-server

Question Implement a calculator for a client-server architecture using socket communication between the client and the server. The client should provide the graphical user interface for the user, and the server should pe ...

Question after 1 year of launch ride sharing increased a

Question: After 1 year of launch, ride sharing increased a lot resulting in a lot of insertion requests to the database. Consider there is no room to further increase the size of server and changing database is not an op ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As