def _append_children(node, clusters_before, clusters_after,
    clusters_reversed, solution_before, solution_after):
    """Append children for the given node.

    Receives a key (representing a node) of one of the dictionaries.
    In order to proceed with building a tree, containing the list of
    nodes required to create a subproblem, the method append the children
    (subnodes) of the given parent. If the node is the key of
    clusters_before or clusters_after dictionary, then the cluster of
    signatures is a part of the currently generating subproblem.

    :param node:
        A key of one of the given dictionaries.

        Example (for example clusters_reversed's key):
            node = A

    :param clusters_before:
        A dictionary containing unique keys and signatures clustered into
        lists (representing the same author), as values.

        Example:
            clusters_before = {1: ['A', 'B'], 2: ['C']}

    :param clusters_after:
        A dictionary containing unique keys and signatures clustered into
        lists (representing the same author), as values.

        Example:
            clusters_after = {3: ['A', 'B'], 4: ['C', D']}

    :param clusters_reversed:
        A dictionary containing values from clusters_before and
        clusters_after dictionaries as the keys and the keys of
        these dictionaries as the values. This dictionary points,
        where the given signatures are stored.

        Example:
            clusters_reversed = {'A': [1, 3], 'B': [1, 3],
                                 'C': [2, 4], 'D': [4]}

    :param solution_before:
        A dictionary of sets containing signatures being selected as the
        part of the currently generating subproblem in the-state-before.

        Example:
            solution_before = {1: set(['A, B'])}

    :param solution_after:
        A dictionary of sets containing signatures being selected as the
        part of the currently generating subproblem in the-state-after.

        Example:
            solution_after = {3: set(['A, B'])}

    :return:
        A list of children of the given node.

        Example:
            [1, 3]
    """
    if node in clusters_before.keys():
        solution_before[node] = clusters_before[node]
        return clusters_before[node]
    if node in clusters_after.keys():
        solution_after[node] = clusters_after[node]
        return clusters_after[node]
    if node in clusters_reversed.keys():
        return clusters_reversed[node]
