def style_nodes(graph_description, node_set, color, dest_node=None, alt_style='dashed'):
    """
    Changes the color of each node in node_set

    :param graph_description: A source string of a graphviz digraph
    :param node_set: A set of node names
    :param color: The color to set the nodes
    :param dest_node: A node name
    :param alt_style: A graphviz node style (e.g. 'dashed')
    :return: A graphviz digraph source
    """
    for node in node_set:
        place = graph_description.find(']', graph_description.find('\t{} ['.format(node)))
        if dest_node is not None and node is not dest_node:
            graph_description = graph_description[:place] \
                                + ' fontcolor={} fillcolor=white color={} style={} penwidth=1'.format(color, color, alt_style) \
                                + graph_description[place:]
        else:
            graph_description = graph_description[:place] \
                                + ' fontcolor={} color={} fillcolor=white style=filled penwidth=2'.format(color, color) \
                                + graph_description[place:]
    return graph_description