Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Review Suggested Edit

You can't approve or reject suggested edits because you haven't yet earned the Edit Posts ability.

Approved.
This suggested edit was approved and applied to the post over 1 year ago by Alexei‭.

46 / 255
  • How do I find idependent sets in a dataset
  • How do I find independent sets in a dataset
  • I have a dataset of car bookings like this:
  • > car_id, user_id
  • >
  • > 1, 1
  • >
  • > 2, 1
  • >
  • > 1, 2
  • >
  • > 3, 3
  • >
  • > 1, 2
  • >
  • > 3, 3
  • In this dataset, two separate groups/sets of cars and users don't overlap: One group consists of two vehicles (1,2) and two users (1,2) the other group has only one car (3) and one user (3). The groups are independent and have no overlap in users or vehicles. Lines in the datasets can repeat.
  • Now I have a much bigger dataset with many thousand cars and users. What is the most elegant/fastest algorithm/data structure to find those disjunct groups?
  • This is an actual problem, not a homework exercise. :-) (I code in python or julia.)
  • I have a dataset of car bookings like this:
  • | car_id | user_id |
  • | ------ | ------- |
  • | 1 | 1 |
  • | 2 | 1 |
  • | 1 | 2 |
  • | 3 | 3 |
  • | 1 | 2 |
  • | 3 | 3 |
  • In this dataset, two separate groups/sets of cars and users don't overlap: One group consists of two vehicles (1,2) and two users (1,2) the other group has only one car (3) and one user (3). The groups are independent and have no overlap in users or vehicles. Lines in the datasets can repeat.
  • Now I have a much bigger dataset with many thousands of cars and users. What is the most elegant/fastest algorithm/data structure to find those disjunct groups?
  • I code in Python or Julia.

Suggested over 1 year ago by trichoplax‭