Find Jobs
Hire Freelancers

Greedy algorithm

€8-30 EUR

Finalizat
Data postării: aproape 5 ani în urmă

€8-30 EUR

Plata la predare
A research laboratory has an expensive scanning probe microscope, shared between different work groups. Every day, groups interested in using the microscope on the next day sive communicate their requests, indicating the time intervals for which they want to book the resource. The head of the laboratory must select a set of compatible requests from each other, and wants to do it in order to satisfy the maximum number of requests. Two requests are among them compatible if the respective time intervals do not overlap. More formally, let us suppose that there are n requests, identified by the numbers 1, · · ·, n. Every request and a couple (si , fi ), where si indicates the instant of beginning and fi the instant of the end of the request the. Obviously, suppose si <fi . We will say that the requests i and j are compatible if fi ≤ sj o fj ≤ si . A subset of requests is compatible if its elements are two-by-two compatible. We ask you to write a program that, given a set of requests, calculates a subset compatible with maximum cardinality. Each request includes four data: (1) a letter, which is identifies the research group; (2) the initial instant of the request; (3) the final instant of the request; (4) a real number, which represents the cost of the operation to be performed. The initial moments and final are integers (we will assume that the time frame in which we can use the microscope be divided into 1440 minutes). The program acquires data from standard input. The first line contains the number n of requests. Each subsequent line contains the four data related to a single request, in the order in which they are described above, and separated by spaces. Suppose the data is correct; in particular, that for each request they are worth (1) si < fi and (2) fi <1440. After calculating the solution, the program must print the selected request data, sorted according to the starting point, and the total cost of the solution. The exercise consists of a form of interval scheduling (or allocation of intervals). In the simple variant proposed here, the solution can be calculated by applying a greedy type algorithm, which at each step chooses, among the residual requests, the one with the minor end instant (excluding, of course, those not compatible with the requests already selected ). Example of input data format: 6 B 120 280 12.34 B 1100 1187 6.34 C 260 480 9.761 A 180 512 11.34 C 360 900 14.2 D 280 512 9.2 For these data, the suggested algorithm provides the solution (B 120 280 12.34) (D 280 512 9.2) (B 1100 1187 6.34) with a total value of 27.88. There is another acceptable solution of cardinality 3, formed by (B 120 280 12.34) (C 360 900 14.2) (B 1100 1187 6.34), with a value of 32.88. It is emphasized that the exercise does not require the determination of a maximum value solution.
ID-ul proiectului: 20340906

Despre proiect

6 propuneri
Proiect la distanță
Activ: 5 ani în urmă

Vrei să câștigi bani?

Avantajele de a licita pe platforma Freelancer

Stabilește bugetul și intervalul temporal
Îți primești plata pentru serviciile prestate
Evidențiază-ți propunerea
Te înregistrezi și licitezi gratuit pentru proiecte
Acordat utilizatorului:
Avatarul utilizatorului
Hello. I read your proposal and the most import important thing of greedy algorithm is greedy strategy. According to the greedy strategy you can speed up the search and accuracy. Keep in touch. Regards
€25 EUR în 1 zi
4,9 (6 recenzii)
3,8
3,8
6 freelanceri plasează o ofertă medie de €81 EUR pentru proiect
Avatarul utilizatorului
Hey there, I am expert in Algorithms and C++. Feel free to inbox me any time. Thank you........................
€60 EUR în 2 zile
4,9 (63 recenzii)
5,3
5,3
Avatarul utilizatorului
Dear,Client. I am checking your requirements carefully. In fact, I have a good experience and skills in algorithm. Dynamic programmin, greedy, graphics algorithms are my major ones. In fact, I have passed many algorithm contests. So I can give you good result. Thank you. Best regards. From Xiuna
€50 EUR în 1 zi
5,0 (8 recenzii)
5,1
5,1
Avatarul utilizatorului
I have a team of 8 people who are extremely good with CSS. HTML, JAVA, PHP and Python. if you provide me the opportunity, i'll finish the work at my earliest without compromising on Quality and will ensure your complete satisfaction. I have done more than 140 works where majority of the work i got 5 star.
€49 EUR în 7 zile
5,0 (7 recenzii)
4,6
4,6
Avatarul utilizatorului
hi wintergreen develops more projects in optimization in matlab. it's need basically 1. encoding variable - scheduling 2. fitness function. - cost 3. constraints based on we have minimize the cost and get the optimized output. if you need any clarification kindly contact through chat...thank you...
€288 EUR în 15 zile
5,0 (3 recenzii)
3,3
3,3
Avatarul utilizatorului
Hello It's rather easy task and I can do it fast because I have a lot of experience in algorithms. Feel free to choose me
€15 EUR în 1 zi
5,0 (1 recenzie)
0,0
0,0

Despre client

Steagul ITALY
Sedriano, Italy
5,0
1
Metoda de plată a fost confirmată
Membru din iul. 15, 2019

Verificarea clientului

Mulțumim! Ți-am trimis prin e-mail linkul pe care trebuie să-l accesezi pentru a revendica creditul gratuit.
A apărut o eroare la trimiterea e-mailului. Încearcă din nou.
Utilizatori înregistrați Totalul proiectelor postate
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Se încarcă previzualizarea
S-a oferit permisiunea de depistare a locației.
Ți-a expirat sesiunea pentru conectare sau te-ai deconectat. Conectează-te din nou.