def is_vertex_coloring(G, coloring):
    """Determines whether the given coloring is a vertex coloring of G.

    Parameters
    ----------
    G : NetworkX graph

    coloring : dict
        A coloring of the nodes of G. Should be a dict of the form
        {node: color, ...}.

    Returns
    -------
    is_vertex_coloring : bool
        True if the given coloring defines a vertex coloring. That is no
        two adjacent vertices share a color.

    """
    return all(coloring[u] != coloring[v] for u, v in G.edges)