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
A _____________ is used to make a deep copy of an object.
lesya [120]
The answer is a 3D Printer
3 0
4 years ago
Why should data anaylst should learn about computer arichtecture.
torisob [31]
The knowledge serves as good foundation for me to understand how technology works behind the scene as well. So I must say a good understanding of computer architecture gives the data scientist the ability to propose feasible solution in capturing and maintaining data, implementing models and algorithms in IT systems.
8 0
3 years ago
A 32-bit number that's used to keep track of where you are in a sequence of TCP segments is known as a(n) ______ number.
scoray [572]

A <u>sequence</u> number is a 32-bit number that's used to indicate where you are in a sequence of TCP segments.

<h3>What is TCP?</h3>

TCP is an acronym for Transmission Control Protocol and it is an essential and important standard protocol of the Internet protocol network.

In Computer technology, TCP is an essential part of the transmission control protocol and internet protocol (TCP/IP) network which has a wide range of applications in the following areas:

  • File transfers
  • World wide web (WWW).
  • Remote administration
  • E-mail

In TCP segments, a <u>sequence</u> number is a 32-bit number that's typically used to indicate where an end user is in a sequence.

Read more on TCP here: brainly.com/question/17387945

8 0
2 years ago
0.6 tenths of an hour would be how many minutes?
astraxan [27]

Answer:

17 min bro

Explanation:

8 0
3 years ago
Read 2 more answers
The part of the computer that provides access to the internet is the-?
Rina8888 [55]
The answer is D. Modem
7 0
3 years ago
Read 2 more answers
Other questions:
  • Can someone show me a image of this completed I will mark brainliest!!! It's typing.com
    11·1 answer
  • Although the American National Standards Institute publishes the specifications for a standard SQL language, each DBMS vendor ha
    7·1 answer
  • Which security control is most helpful in protecting against eavesdropping on wireless LAN (WLAN) data transmissions that would
    6·1 answer
  • An expression involving byte, int, and literal numbers is promoted to which of these?
    12·1 answer
  • What is the meaning of the title Two Kinds Of Stupid whose fault is it that Eduardo got in trouble
    8·1 answer
  • Films on Demand provides you with a digital collection of streaming videos. The database includes documentaries, educational fil
    7·1 answer
  • Como se diseña y produce un material audiovisual
    5·1 answer
  • Why vechiles Tyres are black in colour?​
    14·1 answer
  • What are examples of data duplication in flat files? Check all that apply.
    13·2 answers
  • Which communication network pattern offers a fairly even flow of information, but two people interact with only one other?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!