mod += sum([(dist[k] * y[k]) for k in dist])
for t in trains:
    mod += x[t] <= s[t[0]] + sum([x[k] for k in trains if k[1] == t[0] and 
        k[3] <= t[2]]) - sum([x[k] for k in trains if k != t and k[0] == t[
        0] and k[2] <= t[2]])
mod += sum([s[k] for k in sources]) == 1
for k in dist:
    mod += y[k] <= sum([x[t] for t in trains if t[0] == k[0] and t[1] == k[
        1] or t[1] == k[0] and t[0] == k[1]])
mod.solve()
for t in trains:
    pass
График с расстоянием и временем в пути: найти наибольшее количество километров за 24 часа (с ограничениями)