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
elena-s [515]
4 years ago
14

Suppose you are organizing a party for a large group of your friends. Your friends are pretty opinionated, though, and you don't

want to invite two friends if they don't like each other. So you have asked each of your friends to give you an \enemies" list, which identi es all the other people among your friends that they dislike and for whom they know the feeling is mutual.
Your goal is to invite the largest set of friends possible such that no pair of invited friends dislike each other. To solve this problem quickly, one of your relatives (who is not one of your friends) has offered a simple greedy strategy, where you would repeatedly invite the person with the fewest number of enemies from among your friends who is not an enemy of someone you have already invited, until there is no one left who can be invited. Show that your relative’s greedy algorithm may not always result in the maximum number of friends being invited to your party.
Computers and Technology
1 answer:
Iteru [2.4K]4 years ago
3 0

Answer:

Relative greedy algorithm is not optimal

Explanation:

Proving that Relative’s greedy algorithm is not optimal.

This can be further proved by the following example.

Let us assumethe friends to be invited be Ali, Bill, David, Dennis, Grace, Eemi, and Sam.

The enemy list of each friend is shown below:

• Ali: Bill. David, Dennis

• Bill: Ali, Grace, Eemi, Sam

• David: Ali, Grace, Eemi, Sam

• Dennis: Ali, Grace, Eemi, Sam

• Grace: Bill. David, Dennis. Eemi . Sam

• Eemi: Bill, David, Dennis, Grace, Sam

• Sam: Bill, David, Dennis, Eemi, Grace

From the enemy list, the one with fewer enemies is Ali.

If we invite Ali, then Bill, David, and Dennis cannot be invited.

Next person that can be invited is one from Grace, Eemi, and Sam

If we choose any one of them we cannot add any other person.

For example, if we choose Grace, all other members are enemies of Ali and Grace. So only Ali

and Grace can only be invited.

So we get a list of two members using relative’s greedy algorithm.

This is not the optimal solution.

The optimal solution is a list of 3 members

• Bill, David, and Dennis can be invited to the party.

Hence, it is proved that relative’s greedy algorithm is not optimal, where the maximum number of friends is not invited to the party.

You might be interested in
If you need to use a custom theme frequently, you can save a presentation file as a(n) ____ theme file.
stiks02 [169]
<span>A theme is a coordinated set of colors, fonts, backgrounds, and effects.</span><span>
An installed theme can be accessed and applied by clicking on a theme in the Themes group on the Design tab. </span><span>
If you need to use a custom theme frequently, you can save a presentation file as a(n) Office theme file.</span>
3 0
3 years ago
Read 2 more answers
If you owned an online clothing company and you only had the resources to run one social media campaign, which platform would yo
nikdorinn [45]
Hi!

If I had to pick a social media platform for a clothing company's campaign I would choose Instagram due to its large following and tons of traffic, also the large number of female users, which for a clothing company is usually the target audience.

I would have originally said facebook, but due to recent policy changes that would not be my first choice.

-<span>ASIAX </span><span>  </span><span>Frequent Answerer</span>
3 0
3 years ago
_______________, such as BASIC, Python, Java, Prolog, and C , make the programming process easier by replacing unintelligible st
musickatia [10]

Answer:

High level Languages

Explanation:

High level languages are made so that the byte code, Assembly code that computers can understand should be converted into a higher level human understandable languages such as Python,C++. Also, remember that the compilers of these languages such as Visual studio ultimately converts the high level code into low level code ( Assembly code ) that computers can understand.

8 0
3 years ago
What do you understand by the term polysome?​
jasenka [17]

Answer:

A polyribosome (or polysome or ergasome) is a group of ribosomes bound to an mRNA molecule like “beads” on a “thread”. It consists of a complex of an mRNA molecule and two or more ribosomes that act to translate mRNA instructions into polypeptides.

6 0
3 years ago
• Use variable to create the number 0 at location 0, 400.
pashok25 [27]

Answer: i thinks its

Explanation:

$('button')

 .html('Click me') // Try edit it...

 .on('click', () => console.log(''))

.on('click', () => console.log(''))

.on('click', () => console.log(''))

console.log('App started')

8 0
2 years ago
Other questions:
  • Bullet points on a slide should be limited to _____. 2 4 8 10
    15·2 answers
  • . What is a "secondary dimension" in Google Analytics?
    9·1 answer
  • A customer states that when she removes the printed pages from her laser printer output tray, the black ink smears all over her
    14·1 answer
  • What type of link is used to call this file shown below?
    5·1 answer
  • token is 64 bytes long (the 10-Mbps Ethernet minimum packet size), what is the average wait to receive the token on an idle netw
    6·1 answer
  • import java.util.Scanner; public class StudentScores { public static void main (String [] args) { Scanner scnr = new Scanner(Sys
    5·1 answer
  • Which philosopher believed that if we carefully examine the contents of our experience, we find that there are only two distinct
    10·1 answer
  • A typical day in programming and software development would involve
    12·1 answer
  • Help me? ill do anything ill let u smash me or anything just HELP!
    15·2 answers
  • Write a program with class name Digits that prompts the user to input a positive integer and then outputs the number reversed an
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!