// IsEdgeValid check whether a edge in or not in the graph
// NOTE: for a undirected graph, it will check both from-to and to-from.
IsEdgeValid check whether a edge in or not in the graph
NOTE: for a undirected graph, it will check both from-to and to-from.
// IsEdgeValid check whether a edge in or not in the graph // NOTE : for a undirected graph it will check both from - to and to - from .
func (g adjacencyMatrixGraph) IsEdgeValid(from, to NodeID) bool {
	if !g.IsNodeValid(from) || !g.IsNodeValid(to) {
		return false
	}
	var fromToValid, toFromValid bool
	fromToValid = g.adjMatrix[from][to]
	if g.directed {
		return fromToValid
	}
	toFromValid = g.adjMatrix[to][from]
	return fromToValid && toFromValid
}
func ( g adjacencyMatrixGraph ) IsEdgeValid ( from , to NodeID ) bool { if ! g . IsNodeValid ( from ) || ! g . IsNodeValid ( to ) { return false } var fromToValid , toFromValid bool fromToValid = g . adjMatrix [ from ] [ to ] if g . directed { return fromToValid } toFromValid = g . adjMatrix [ to ] [ from ] return fromToValid && toFromValid }
IsEdgeValid check whether a edge in or not in the graph
NOTE: for a undirected graph, it will check both from-to and to-from.
IsEdgeValid check whether a edge in or not in the graph NOTE : for a undirected graph it will check both from - to and to - from .
// for undirected graph, check both from-to and to-from