finds doubly connected by edges components