def METHOD_NAME(comm, nRows):
    map = Epetra.Map(nRows, 0, comm)
    graph = Epetra.CrsGraph(Epetra.Copy, map, 3)
    for gid in map.MyGlobalElements():
        if gid == 0:
            indices = [0, 1]
        elif gid == nRows-1:
            indices = [nRows-2, nRows-1]
        else:
            indices = [gid-1, gid, gid+1]
        graph.InsertGlobalIndices(gid, indices)
    graph.FillComplete()
    return graph