def shortest_path(g, start, goal):
    """ Complete BFS via MIT algorith

    g -> Graph represented via Adjacency list (Dict of sets)
    start -> start vertex
    goal -> end vertex

    Returns shortests path from start to goal
    """
    # level will contains shortest path for each vertex to start
    level = {start: 0}
    # parent will contains backtracks for each vertex to its parent
    parent = {start: None}
    i = 1
    frontier = [start]
    while frontier:
        next_f = []
        for u in frontier:
            for v in g[u]:
                if v not in level:
                    level[v] = i
                    parent[v] = u
                    next_f.append(v)
        frontier = next_f
        i += 1
    return level[goal] - 1