func (v *Vertex) RemoveEdge(other *Vertex) bool {
	if v.Graph != other.Graph {
		return false
	}
	if !v.IsAdjacent(other) {
		return false
	}
	updateNeighbors := func(cur, target *Vertex) []*Vertex {
		var removeIndex int
		for i, n := range cur.Neighbors {
			if n == target {
				removeIndex = i
			}
		}
		if len(cur.Neighbors) == 1 {
			return []*Vertex{}
		}
		return append(cur.Neighbors[:removeIndex], cur.Neighbors[removeIndex+1:]...)
	}
	v.Neighbors = updateNeighbors(v, other)
	other.Neighbors = updateNeighbors(other, v)
	return true
}
RemoveEdge removes a neighboring vertex from its list
package graph
type Vertex struct {
	Value int
	Graph *Graph
	Neighbors []*Vertex
}
func (v *Vertex) GetNeighbors() []*Vertex {
	return v.Neighbors
}
func (v *Vertex) IsAdjacent(other *Vertex) bool {
	if v.Graph != other.Graph {
		return false
	}
	for _, n := range v.Neighbors {
		if n == other {
			return true
		}
	}
	return false
}