Prim's algorithm: pick-up and drop-off locations for packages

  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    even
Click For Summary

Discussion Overview

The discussion revolves around a problem related to Prim's algorithm in the context of determining pick-up and drop-off locations for packages by an e-commerce company. Participants explore the requirements of the problem, the clarity of the question, and the implications of the minimum distance constraint between drop centers, as represented in a weighted, undirected graph.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification
  • Meta-discussion

Main Points Raised

  • Some participants express confusion about the problem statement and the specific requirements regarding the minimum distance between drop centers.
  • There is a suggestion that Prim's algorithm may be relevant to the problem, although some participants are unfamiliar with it.
  • One participant notes that the minimum distance is a parameter that must be considered when determining valid subsets of drop centers.
  • Concerns are raised about the quality of the question, with some participants suggesting it may be poorly posed or even click bait.
  • A participant shares their experience of encountering a similar question in a coding interview, indicating confusion and lack of clarity in the problem.
  • Another participant comments on the potential origins of the question, speculating it may have been sourced from Chegg, and discusses the implications of poorly constructed questions in coding interviews.

Areas of Agreement / Disagreement

Participants generally express disagreement regarding the clarity and quality of the problem statement. There is no consensus on the interpretation of the requirements or the relevance of Prim's algorithm, as some participants are unsure about its application.

Contextual Notes

Participants note that the problem lacks clear definitions and parameters, such as the graph weights, which complicates the understanding of the requirements. Additionally, the use of acronyms without definition contributes to the confusion.

Who May Find This Useful

This discussion may be of interest to individuals preparing for coding interviews, those studying algorithms, or participants seeking to understand the application of graph theory in practical scenarios.

member 428835
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:
Technology news on Phys.org
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.
 
Baluncore said:
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?
 
joshmccraney said:
What is the requirement?
"they want to ensure that their drop centers are a minimum distance apart from each other."
 
Mark44 said:
"they want to ensure that their drop centers are a minimum distance apart from each other."
So like Prim's algorithm?
 
joshmccraney said:
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.
 
Mark44 said:
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.
 
  • Like
Likes   Reactions: jim mcnamara, pbuk and member 428835
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:
  • #10
Baluncore said:
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:
  • #11
pbuk said:
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.
 
  • #12
Maybe the interviewer found the question on Chegg.com
Maybe they wanted to see how you would react when intimidated by such a poorly posed problem.
 
  • Like
Likes   Reactions: member 428835 and berkeman
  • #13
Baluncore said:
Maybe the interviewer found the question on Chegg.com
Maybe they wanted to see how you would react when intimidated by such a poorly posed problem.
LOLOL it was generated by a computer, and it didn't have the lines and line weights. Also, it used the acronym "pdcs" without definition, along with several other errors. Also, one multiple choice answer about flow charts wasn't available. I even coded it afterwords and nada. The whole process was very weird.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 19 ·
Replies
19
Views
2K
Replies
29
Views
5K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
2
Views
3K