# What's this question even asking? (pick-up and drop-off locations for packages)

Gold Member
This question statement is below, but I can't find out what it's even asking. Any help?

[chegg link redacted by the Mentors after the content was posted below. Please avoid posting low-quality chegg links]

Last edited by a moderator:

1. Drop-off Centers
An e-commerce company, WhatDoYouWant, wants to contract with local businesses to use their stores as pick-up and drop-off locations for their packages. To reduce expenses, they want to ensure that their drop centers are a minimum distance apart from each other.
A city has many potential drop centers (pdcs) to choose from, represented as nodes on a weighted, undirected graph. The edges on this graph denote roads that connect pdcs, with weights representing the lengths of the roads.
Determine how many unique subsets of these companies can be contracted that would satisfy that requirement.

Gold Member
1. Drop-off Centers
An e-commerce company, WhatDoYouWant, wants to contract with local businesses to use their stores as pick-up and drop-off locations for their packages. To reduce expenses, they want to ensure that their drop centers are a minimum distance apart from each other.
A city has many potential drop centers (pdcs) to choose from, represented as nodes on a weighted, undirected graph. The edges on this graph denote roads that connect pdcs, with weights representing the lengths of the roads.
Determine how many unique subsets of these companies can be contracted that would satisfy that requirement.
What is the requirement?

Mentor
What is the requirement?
"they want to ensure that their drop centers are a minimum distance apart from each other."

Gold Member
"they want to ensure that their drop centers are a minimum distance apart from each other."
So like Prim's algorithm?

Mentor
So like Prim's algorithm?
I don't know anything about Prim's algorithm. You asked "What is that requirement?"
My answer was based on what Baluncore wrote, which I presume came directly from the problem you linked to.

Gold Member
I don't know anything about Prim's algorithm. You asked "What is that requirement?"
My answer was based on what Baluncore wrote, which I presume came directly from the problem you linked to.
So for the first triangle shown, would the answer be 5, since all circles are connected with total length 5?

Does such a poorly posed question deserve such attention ?
Maybe it is just click bait, designed to get you to sign up.

jim mcnamara, pbuk and joshmccraney
Homework Helper
Gold Member
The minimum distance is provided as a parameter to the function you must write as your solution. In the example shown the minimum distance is 4. As the distance between nodes 1 and 2 in the diagram for this example is 3 then any subset that includes both nodes 1 and 2 violates the minimum distance constraint. Note that the example is not expressed correctly as there is no graph_weight argument provided; can you work out what it should be given the weights in the diagram?

Last edited:
Homework Helper
Gold Member
Does such a poorly posed question deserve such attention ?
Maybe it is just click bait, designed to get you to sign up.
Chegg seems to be featuring a lot in threads here recently, and also in general internet search results: they must have been pumping it on many levels and obviously plan to make a lot of money. Some of their questions and examples clearly need debugging: do we want to help them do this?

Last edited:
Gold Member
Chegg seems to be featuring a lot in threads here recently, and also in general internet search results: they must have been pumping it on many levels and obviously plan to make a lot of money. Some of their questions and examples clearly need debugging: do we want to help them do this?
Well, it's weird because this was literally a coding interview question I had. I obviously didn't take the time to post this until after the interview was complete (not a cheater and honestly no time), but I had no clue what the question was asking. Consequently I didn't even attempt the question. But after the interview I started googling to see what on Earth was being asked. Still don't fully understand, but I'm fine with that.