def _detect_overlap(self, node, ideal_col, row_idx, min_col):
        """
        Detect if any overlap will be caused if node in row_idx is placed at column col.

        :param node:            The node.
        :param int ideal_col:   The ideal column index.
        :param int row_idx:     The row that the node is placed at.
        :param int min_col:     The left-most acceptable column index for this node.
        :return:                (bool, int|None), where the first value is True if overlap is detected, False otherwise;
                                the second value is the suggested column.
        :rtype:                 tuple
        """

        overlap_detected = False
        suggested_col = min_col  # will only be used if overlap is detected

        # overlap detection
        for samerow_node in sorted(self._row_to_nodes[row_idx], key=lambda n: self._cols[n]):
            if samerow_node is node:
                continue
            samerow_node_col = self._cols[samerow_node]
            if samerow_node_col - 1 <= ideal_col <= samerow_node_col + 1:
                # collision detected :(
                overlap_detected = True
            if samerow_node_col - 1 <= suggested_col <= samerow_node_col + 1:
                # adjust our suggestion, which will be tested in the next iteration
                suggested_col = samerow_node_col + 2
            if overlap_detected and suggested_col < samerow_node_col - 1:
                # amazing, we got a suggestion working!
                # early termination of the loop
                break

        if overlap_detected:
            return True, suggested_col
        else:
            return False, ideal_col

        Detect if any overlap will be caused if node in row_idx is placed at column col.

        :param node:            The node.
        :param int ideal_col:   The ideal column index.
        :param int row_idx:     The row that the node is placed at.
        :param int min_col:     The left-most acceptable column index for this node.
        :return:                (bool, int|None), where the first value is True if overlap is detected, False otherwise;
                                the second value is the suggested column.
        :rtype:                 tuple
        
angrmanagement/utils/graph_layouter.py