@staticmethod
def __symmetric_difference(first_neighbors_dict, second_neighbors_dict):
    """
        Calculates the difference of weights of first and second node dicts,
        doing also a symmetric difference between the sets of nodes.

        :param first_neighbors_dict: dict, keys: node_pub_keys,
                                           values: node weights
        :param second_neighbors_dict: dict, keys: node_pub_keys,
                                            values: node weights
        :return: dict, keys: node_pub_keys, values: node weights
        """
    first_nodes = set(first_neighbors_dict.keys())
    second_nodes = set(second_neighbors_dict.keys())
    nodes_intersection = first_nodes.intersection(second_nodes)
    unique_first_nodes = first_nodes - nodes_intersection
    unique_second_nodes = second_nodes - nodes_intersection
    diff_neighbor_dict = {}
    for n in unique_first_nodes:
        diff_neighbor_dict[n] = first_neighbors_dict[n]
    for n in unique_second_nodes:
        diff_neighbor_dict[n] = second_neighbors_dict[n]
    for n in nodes_intersection:
        delta = first_neighbors_dict[n] - second_neighbors_dict[n]
        if delta != 0.0:
            diff_neighbor_dict[n] = delta
    return diff_neighbor_dict
