remove method
If there is such a node, remove it
Return false when there is no such node
Implementation
bool remove(val) {
if (_map.containsKey(val)) {
final node = _map[val]!;
for (var from in node.from) {
from.to.remove(node);
}
for (var to in node.to.keys) {
to.from.remove(node);
}
_node_to_val.remove(node);
_map.remove(val);
return true;
}
return false;
}