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
  Non-greedy regex WJSwan 1 915 Mar-07-2023, 09:15 PM
Last Post: Larz60+
  Help with Logical error processing List of strings dmc8300 3 1,084 Nov-27-2022, 04:10 PM
Last Post: Larz60+
  Unable to bit shift and logical OR bytes and ints? MysticLord 7 7,008 Sep-01-2020, 03:31 PM
Last Post: deanhystad
  Basic logical errors cpopescu 3 2,060 Jun-03-2020, 11:30 AM
Last Post: menator01
  Python logical operator AND rasec70 4 2,529 May-07-2020, 03:40 PM
Last Post: pyzyx3qwerty
  I need help with Python code to implement this algorithms Saemmanuex 1 2,054 Jul-07-2019, 02:07 PM
Last Post: DeaD_EyE
  parsing logical expression with pyparsing palo173 2 5,488 May-13-2019, 09:22 AM
Last Post: palo173
  Looking for good doc on Scraping coverage algorithms Larz60+ 0 1,907 Jan-05-2019, 03:22 PM
Last Post: Larz60+
  Python - sorting algorithms hrca 3 3,176 Nov-06-2018, 07:06 PM
Last Post: hrca
  Job Scheduling to be solved with Greedy algorithm hfan6206 1 3,496 Jun-05-2018, 04:02 AM
Last Post: hfan6206

Forum Jump:

User Panel Messages

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