refactored graph to optionally connect neighbors around a node that is removed rather than blindly removing everything