// EdgeCount return how many edges in the graph
// NOTE: for a undirected graph, from-to and to-from count as same edge.
EdgeCount return how many edges in the graph
NOTE: for a undirected graph, from-to and to-from count as same edge.
// EdgeCount return how many edges in the graph // NOTE : for a undirected graph from - to and to - from count as same edge .
func (g adjacencyMatrixGraph) EdgeCount() int {
	var count int
	g.IterateAllNodes(func(u NodeID) {
		g.IterateAdjacencyNodes(u, func(_ NodeID) {
			count++
		})
	})
	if !g.directed {
		return count / 2
	}
	return count
}
func ( g adjacencyMatrixGraph ) EdgeCount ( ) int { var count int g . IterateAllNodes ( func ( u NodeID ) { g . IterateAdjacencyNodes ( u , func ( _ NodeID ) { count ++ } ) } ) if ! g . directed { return count / 2 } return count }
EdgeCount return how many edges in the graph
NOTE: for a undirected graph, from-to and to-from count as same edge.
EdgeCount return how many edges in the graph NOTE : for a undirected graph from - to and to - from count as same edge .