import random


def create_nodes(n=300, seed=None):
    """Sample $n$ nodes uniformly at random in the unit square. Each of
    the nodes comes with a random time sampled uniformly from [0, n].
    # Arguments
        n: number of nodes to be sampled
        seed: seed for the randomness
    # Result
        lists ts, xs, ys of time-coordinates x-coordinates and y-coordinates.
        Sorted increasingly in time
    """
    random.seed(seed)
    xs, ys, ts = [[random.random() for _ in range(n)] for _ in range(3)]
    ts = [n * t for t in ts]
    return list(zip(*[[t,x,y] for t,x,y in sorted(zip(ts,xs,ys))]))