Skip to content

Conversation

truggeri
Copy link
Owner

@truggeri truggeri commented Jan 4, 2025

Summary

Solved using two data structures,

  1. A map keyed on a computer identifier and containing a slice (vector, list) of all the connected machines.
  2. A map keyed on the connection between two computers and containing true

This allows us to iterate through ever computer connected to a t computer and in O(1) time look up if those computers are connected. The tricky bit is identifying double or triple counts.

@truggeri truggeri self-assigned this Jan 4, 2025
@truggeri truggeri merged commit 651ab98 into main Jan 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant