
So the answer is no, that even with any

of these restrictions, we still don't have a good

definition. So, let's consider all the restrictions. So, the

first one was, if everyone is friends with Alice. So

that would only work if they don't have any

other friends. Let's say this is Alice. We've got

Bob and Charlie. They're both friends with Alice. But

Bob is also friends with Charlie and Charlie is friends

with Bob. That means that to figure out the popularity of

Bob we need to know the popularity of Charlie. To figure

out the popularity of Charlie we need to know the popularity

of Alice as well as the popularity of Bob. So we're never

going to get to a solution. We are going to keep

bouncing back and forth between Bob and Charlie doing this. The

second choice only if no one is friends with Alice. Well,

if no one was friends with Alice, that would remove these links.

It doesn't solve our problem. We're still not going to be able

to give a popularity score for Bob and Charlie. The third choice

only if there is a friendship path from everyone in the graph

that eventually reaches Alice. So adding this link would provide that property,

but it still doesn't solve our problem. It doesn't give us a

way to figure out the popularity of Charlie, because to know that,

we need to know the popularity of Bob, which we need to

know the popularity of Charlie for. We still end up in this cycle.

The final choice seems, possibly more promising. It says

there are no cycles in the graph, so if

we want to remove this cycle. We could do

this. In this case, we'd be okay, right? We could

figure out the popularity of Bob, by figuring out

the popularity of Charlie, which depends on the popularity

of Alice. Where we're not okay, is if Bob

has another friend. Let's say Bob is friends with Diana.

Well then, to figure out the popularity of Diana,

we need to know the popularity of Bob. Where

it breaks down is, suppose we also have Diana

and Edgar, and Diana's friends with Edgar. To figure out

the popularity score of Diana, we need to know the popularity score

of Edgar. We don't have a cycle, but we don't have an answer

either. To figure out the popularity of Edgar,. We are going to go through

Edgar's friends, and the way the Python code is written. This could actually

work, right? Because if we define popularity when you have no friends.

Well, if the friends of p is empty, when we go through this

loop, the score is going to be 0. So, if you answered there are

no cycles. That's at least worth credit for this, that could be correct.

In terms of the mathematical definition, it doesn't make very good

sense. We still needed a way to know the popularity of

Edgar. We've sort of defined things in this case to say,

if you have no friends, your popularity score is zero. And

the Python code will work for that. But it's not a

good way to define popularity. So its very arbitrary to say

we're going to make Alice the one whose popularity score is predefined

as one. There is nothing Alice could do to make herself

more popular. That's not very fair to

Alice and it doesn't give us meaningful scores.