Skip to content

nikhilsaggi submission#33

Open
nikhilsaggi wants to merge 3 commits into
mpage:mainfrom
nikhilsaggi:feat/nikhilsaggi-submission
Open

nikhilsaggi submission#33
nikhilsaggi wants to merge 3 commits into
mpage:mainfrom
nikhilsaggi:feat/nikhilsaggi-submission

Conversation

@nikhilsaggi

@nikhilsaggi nikhilsaggi commented May 16, 2026

Copy link
Copy Markdown

Implement parallel target building with dependency management.

Submission Checklist

  • My file is named submissions/<github_username>.py.
  • My submission runs locally.
  • My output matches the expected output.
  • I did not hardcode the final output.

Approach Description

Using Kahn's algorithm. We track and maintain the following:

  • ready: all targets that are ready to be built
  • remaining tracks, for each target, how many remaining dependent targets it has
  • dependents tracks, for each target, which targets are dependent on it

We instantiate the above variables. Each worker runs the worker() function, which

  1. pulls targets from ready
  2. calls build() on them
  3. updates above variables

Algorithm terminates when sentinel is pushed to queue, indicating threads to terminate.

Implement parallel target building with dependency management.
@github-actions

Copy link
Copy Markdown
Contributor

✅ Results

Metric Value
Speedup 5.7585696514413325x
Passed true
Graphs 5

Per-graph results

Graph Speedup Status
chain.json 0.9688549410311909x
diamond.json 11.511157449051403x
realistic.json 23.237478995148933x
tree.json 21.049538689587287x
wide.json 21.454230349830258x

View the leaderboard

Refactor build_all function to optimize threading and dependency management
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant