Atelier des rouesLab FR
Objects/Documentation

trois22.py

The first graph where preparing an output saves work · trois22.py

Download ↓
"""All topologically labelled DAGs with exactly three terminal outputs, n=4,5."""
from itertools import product,permutations
import json
from motifs21 import solve


def independent(parents,order,cap,early):
    needed=[sum(1<<p for p in row) for row in parents]
    front={(0,0)};seen=set();depth=0
    while front:
        if any(i==3 for _,i in front):return depth
        seen.update(front);nxt=set()
        for mask,i in front:
            for j,ps in enumerate(needed):
                if mask>>j&1 or mask&ps!=ps or j in order[:i] or (not early and j in order[i+1:]):continue
                sub=mask

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.