Python Forum
Greedy algorithms on logical problems
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Greedy algorithms on logical problems
#1
Hello fellow python programmers,

I have the following problem:

I have got k gifts and k people. Every gift is denoted by [1..k] and every person as well.
Every person has 3 wishes [x, y , z] which all correspond to one gift. Every person will get a gift and every gift is unique. How do I accomplish, that I achieve these goals:
1st Maximum of people should get their first wish
2nd Maximum of people should get their second wish --> Optimization after the first step which is more important
3rd Maximum of people should get their third wish, if their first and second wish wasn't fullfilled.

I've thought about a greedy algorithm, but I'm lost
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  HELP!!! string logical sorting kucingkembar 13 2,106 Aug-09-2024, 07:17 PM
Last Post: snippsat
  Learning from Grokking Algorithms Zepher 4 1,351 Jul-23-2024, 02:01 PM
Last Post: Zepher
  Non-greedy regex WJSwan 1 1,534 Mar-07-2023, 09:15 PM
Last Post: Larz60+
  Help with Logical error processing List of strings dmc8300 3 1,871 Nov-27-2022, 04:10 PM
Last Post: Larz60+
  Unable to bit shift and logical OR bytes and ints? MysticLord 7 10,050 Sep-01-2020, 03:31 PM
Last Post: deanhystad
  Basic logical errors cpopescu 3 2,962 Jun-03-2020, 11:30 AM
Last Post: menator01
  Python logical operator AND rasec70 4 3,730 May-07-2020, 03:40 PM
Last Post: pyzyx3qwerty
  I need help with Python code to implement this algorithms Saemmanuex 1 2,547 Jul-07-2019, 02:07 PM
Last Post: DeaD_EyE
  parsing logical expression with pyparsing palo173 2 6,646 May-13-2019, 09:22 AM
Last Post: palo173
  Looking for good doc on Scraping coverage algorithms Larz60+ 0 2,432 Jan-05-2019, 03:22 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020