Timeline for Elegant solution to a graph problem
Current License: CC BY-SA 4.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 18 at 0:45 | comment | added | candied_orange | @Toph sure. The reason I insist that there is more than one y is because when you model this that way there is no temporal issue because there is no time. Where you would move things as a group I'd just make a modified copy of the group. You get the same data without weird timing issues. | |
| Jul 17 at 15:27 | comment | added | Toph | This reminds me of a vector art program I use, where you can "group" shapes so that they move as one, and groups can be elements of other groups. I can select a single shape, or a group and all its contents, and translate/rotate/scale/etc. it, and if it's a group then all its descendants will be repositioned correctly. | |
| Jul 15 at 22:13 | comment | added | Filip Milovanović | @NWoodsman So, in your approach with parent references, when client code needs to use the orange node, can your arrange for your orange node to externally appear as a data structure, but to internally compute the value dynamically. For example, if it points to the translate node, and that node itself has no successors, just return a cached value; if it does, continue the computation, walking the graph until the last transform is reached, then cache that and return. That way, the orange node updates itself on read, and it's a one-time thing. Is something along those lines feasible? | |
| Jul 13 at 22:24 | comment | added | candied_orange | @NWoodsman going by what you just said in the comments, transforming slot A to B looks like this: ?->A->B. Which either requires updating ? Or detecting that B terminates. Point B at null and ? can find B at the end. But that is simply a data structure. It doesn’t create an ordering of your dependencies. | |
| Jul 13 at 20:15 | comment | added | NWoodsman | A key feature of the system is to to give users the ability to refer to an existing slot and obtain a deep-copy of said slot. Which is exemplified by the orange node. That is practically the entire design. | |
| Jul 13 at 19:56 | comment | added | NWoodsman | Without going too detailed, i'm creating a runtime system where users can instantiate new "slots" with the option of the "slot" being within an existing "slot". So a natural graph structure results, with nested slots within slots. Each "slot" can be assigned a primitive value or a tranform. My app starts at the deepest nested slots i.e. the leaves and analyzes the primitive values to determine the outer/parent slot "type" based on the nested types. So there is a recursive, depth-first analysis. The user manipulates the slots at runtime to create their own graph-like structure. | |
| Jul 13 at 16:05 | comment | added | Filip Milovanović | Right, that's why I asked the OP to clarify; again, you might be perfectly correct in your interpretation of the question, but I'm wondering if the OP is coming, say, from a math or physics background, and if the way they naturally think about the problem is leading them to a particular implementation strategy (actual graph data structure), and if that is what's causing them difficulties. Of course, I could be wrong. | |
| Jul 13 at 15:47 | comment | added | candied_orange | @FilipMilovanović those are simply implementation details. I took the subject to be analyzing the dependencies. How you calculate is a different issue. Unless I’m missing something this became needlessly complex when what you call mesh + transform got mixed with navigating to the observed Y. That last bit is about structure not dependency. | |
| Jul 13 at 15:30 | comment | added | Filip Milovanović | "What you've created here is a snapshot, command log, replay system" - this could be the case, but I'm wondering if the OP hasn't gone down an approach that has made things more complicated than they need to be, by making the representation in code be a literal graph. E.g. maybe the "history" (or the "log") of transforms is of no interest in and of itself, maybe all they care about is having a way to make a complicated transform by composing simpler ones, the way people who are in 3D graphics do (matrix algebra). Like, it could be that this is better represented as a mesh + transform matrices? | |
| Jul 13 at 3:35 | history | edited | candied_orange | CC BY-SA 4.0 | added 28 characters in body |
| Jul 13 at 3:28 | history | answered | candied_orange | CC BY-SA 4.0 |