emory-courses / dsa-java

Data Structures and Algorithms in Java
https://emory.gitbook.io/dsa-java/
42 stars 55 forks source link

[QZ#6] Graph Edge Weight #173

Closed LukHan99 closed 4 years ago

LukHan99 commented 4 years ago

Can we assume that the weights of the edges in the graph will all be set to 0 when the graph is constructed?

LukHan99 commented 4 years ago

If it is not a reasonable assumption, then are we allowed to change the weights of the edges in the graph?

marvinquiet commented 4 years ago

For detecting cycles, we can just consider it as 0 because we focus more on the direction of edges.