1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-11-05 09:36:19 +00:00
CC-Tweaked/projects
Jonathan Coates 84b6edab82
More efficient removal of wired nodes from networks
When we remove a wired node from a network, we need to find connected
components in the rest of the graph. Typically, this requires a
traversal of the whole graph, taking O(|V| + |E|) time.

If we remove a lot of nodes at once (such as when unloading chunks),
this ends up being quadratic in the number of nodes. In some test
networks, this can take anywhere from a few seconds, to hanging the game
indefinitely.

This attempts to reduce the cases where this can happen, with a couple
of optimisations:

 - Instead of constructing a new hash set of reachable nodes (requiring
   multiple allocations and hash lookups), we store reachability as a
   temporary field on the WiredNode.

 - We abort our traversal of the graph if we can prove the graph remains
   connected after removing the node.

There's definitely future work to be done here in optimising large wired
networks, but this is a good first step.
2024-02-24 15:02:34 +00:00
..
common More efficient removal of wired nodes from networks 2024-02-24 15:02:34 +00:00
common-api Deprecate WiredNetwork 2024-02-24 14:55:22 +00:00
core Bump CC:T to 1.109.6 2024-02-18 18:33:42 +00:00
core-api Allow ILuaAPIs to be exposed as a module 2024-02-05 18:53:24 +00:00
fabric Use client-side commands for opening computer folders 2024-01-30 22:00:36 +00:00
fabric-api Rewrite turtle upgrade modeller registration API 2024-01-16 23:00:49 +00:00
forge Change how we put test libraries on the class path 2024-01-31 19:49:36 +00:00
forge-api Rewrite turtle upgrade modeller registration API 2024-01-16 23:00:49 +00:00
lints Flesh out MemoryMount into a writable mount 2023-09-29 22:15:23 +01:00
standalone Allow local domains in the standalone emulator 2023-12-20 17:43:08 +00:00
web Bump CC:T to 1.109.1 2023-12-16 19:09:39 +00:00
ARCHITECTURE.md Add a standalone CC:T UI 2023-10-28 17:58:11 +01:00