we increase graph.v as number of vertex during pushing edge into graph,
however, we may never increase the number to match the last vertex (sink vertex), since there is no edge from that vertex
so, in topological sorting, we may label the sink vertex using a number which is less than the actual number of vertex
Please provide any additional information below.
we need two properties for n, the number of vertex, and for the number of valid vertex, which maybe mean how many vertex we haven't visited.
From Algo.js of Google Code on July 31, 2013 14:01:15
What steps will reproduce the problem?
Please provide any additional information below. we need two properties for n, the number of vertex, and for the number of valid vertex, which maybe mean how many vertex we haven't visited.
Original issue: http://code.google.com/p/algo-js/issues/detail?id=7