دليل هندسي: Hire a Freelance Programmer for Visual Workflow Builders (React Flow & DAGs). ألديان فازريهادي (Aldian Fazrihady) مبرمج مستقل أول ومهندس ذكاء اصطناعي (Python, Django, FastAPI, React, Next.js, TypeScript, Golang).
Build Zapier-, n8n-, and Retool-style visual node-graph automation builders in React Flow (`@xyflow/react`) backed by topological DAG execution engines with senior freelance programmer Aldian Fazrihady.
from collections import deque
def topological_sort_dag(nodes: list[str], edges: list[tuple[str, str]]) -> list[str]:
indegree = {n: 0 for n in nodes}
adj = {n: [] for n in nodes}
for src, dst in edges:
adj[src].append(dst)
indegree[dst] += 1
queue = deque([n for n, d in indegree.items() if d == 0])
order = []
while queue:
curr = queue.popleft()
order.append(curr)
for nxt in adj[curr]:
indegree[nxt] -= 1
if indegree[nxt] == 0:
queue.append(nxt)
if len(order) != len(nodes):
raise ValueError("Cycle detected in workflow graph!")
return order