// DeleteEdge delete en edge between FromNode and ToNode from the graph.
// make sure both FromNode and ToNode are already inside the graph.
// NOTE: for a undirected graph, this func will delete both from-to and to-from from the graph.
DeleteEdge delete en edge between FromNode and ToNode from the graph.
make sure both FromNode and ToNode are already inside the graph.
NOTE: for a undirected graph, this func will delete both from-to and to-from from the graph.
// DeleteEdge delete en edge between FromNode and ToNode from the graph . // make sure both FromNode and ToNode are already inside the graph . // NOTE : for a undirected graph this func will delete both from - to and to - from from the graph .
func (g adjacencyMatrixGraph) DeleteEdge(from, to NodeID) error {
	if !g.IsNodeValid(from) || !g.IsNodeValid(to) {
		return fmt.Errorf("From node %v or To node %v invalid", from, to)
	}
	g.adjMatrix[from][to] = false
	if !g.directed {
		g.adjMatrix[to][from] = false
	}
	return nil
}
func ( g adjacencyMatrixGraph ) DeleteEdge ( from , to NodeID ) error { if ! g . IsNodeValid ( from ) || ! g . IsNodeValid ( to ) { return fmt . Errorf ( " " , from , to ) } g . adjMatrix [ from ] [ to ] = false if ! g . directed { g . adjMatrix [ to ] [ from ] = false } return nil }
DeleteEdge delete en edge between FromNode and ToNode from the graph.
DeleteEdge delete en edge between FromNode and ToNode from the graph .
// for undirected graph, delete both from-to and to-from from the graph