Join Slack
Powered by
I’ve been going along in rust this year, but graph...
# advent-of-code
j
joelpedraza
12/07/2018, 1:11 PM
I’ve been going along in rust this year, but graphs are
hard
in rust, so I’m considering doing kotlin for day 6.
a
andyb
12/07/2018, 1:13 PM
Can you not just use Rust's Vectors & HashMaps to model the relationships?
j
joelpedraza
12/07/2018, 1:15 PM
It’s nontrivial to do it by creating adjacency lists made of references
joelpedraza
12/07/2018, 1:15 PM
Because of the ownership and borrowing semantics of the language
a
andyb
12/07/2018, 1:15 PM
Ok
j
joelpedraza
12/07/2018, 1:15 PM
If A owns B, B cant own A
joelpedraza
12/07/2018, 1:16 PM
The way to do it without pulling out your hair is to store edges as indices into a vec
g
Gerard Klijs
12/07/2018, 2:07 PM
I'm also doing rust, but before kind of considered taking the best fitted language for the problem. However I'm gonna give it a try anyway
4
Views
Open in Slack
Previous
Next