def get_v_structures(g):
    """
    Gets all the v-structures in g. For three nodes, a, b, c, where a is connected to b,
    b is connected c, and a and c are not connected, this configuration is called a v-structure.

    :param g: Undirected graph.
    :return: List of tuples representing v-structure.
    """
    v_structures = []
    nodes = list(g.nodes)
    for node in nodes:
        neighbors = list(g.adj[node])
        for ne1 in neighbors:
            for ne2 in neighbors:
                if ne1 < ne2 and ne1 not in g.adj[ne2] and ne2 not in g.adj[ne1
                    ]:
                    t = ne1, node, ne2
                    v_structures.append(t)
    return v_structures
