Can topological sorting be applied to graphs with weighted edges? Explain.

  • No, topological sorting is only applicable to graphs with unweighted edges.
  • Yes, as long as the weights are positive.
  • Yes, but only if the weights are integers.
  • Yes, regardless of the weights on the edges.
Topological sorting is applicable to graphs with unweighted edges. The algorithm relies on the absence of cycles, and introducing weights does not impact the sorting order. However, the weights themselves are not considered in the topological sorting process.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *