kaist-cp/cs500

Implementation X and F in Dijkstra's Algorithm

Closed this issue · 2 comments

Hi again!

In the lecture notes the following is stated:

Cost When representing X as a boolean sequence and F as an index sequence, ...

In line 12 we have this:
image
So it looks to me that we are subtracting a boolean sequence that represents vertices with an index sequence that also represents vertices. I guess to do this operation we need to do an implicit conversion to have both variables in the same format. I think this conversion takes |V| so I am not sure if doing this is efficient... What's the goal of this? I am not sure, but I have the feeling that line 9 and 10 would still have a cost of |V| if we use a boolean sequence for X and F. Any ideas about this?

Thanks

In the lecture note, I defined minus F X that is more efficient than converting X to an index sequence.

Ahhhh yes yes, that's right. Thank you!