Invariant-preserving binary encoding of graph transformation rules Computer Science |
Invariant-preserving binary encoding of graph transformation rules Posted: 30 Jul 2021 08:33 PM PDT So first a bit of background to clarify what I mean (the graph transformation notation below is the same as used by Wolfram.) Graphs can be seen as sets of relations, so Graph transformation rules can be defined so that they have a pattern of relations they match, and a pattern that they produce: with that example graph, applying the rule Rules have an arity, and since hyperedges (edges with more than one node) are allowed this arity can be mixed: eg. To guarantee that the produced graphs are always at least weakly connected, the following invariants must hold for all rules:
Now, my question is this: how could I come up with a binary representation for rules that works with an arbitrary but predefined arity (ie. the arity depends on configuration parameters and won't change during the decoding), so that any binary string of some maximum length will always encode a correct rule that preserves those invariants? This would naturally mean that multiple strings could decode to the same rule, i.e. it'd be a surjective mapping. What I don't want is to have to reject encoded strings if they don't produce correct rules; all strings must result in a valid transformation. Not looking to be handed an answer, any ideas or pointers are welcome. [link] [comments] |
Posted: 15 Jul 2021 02:09 PM PDT So, I was wondering whether there are any other non-obvious methods for doing this that require less memory. Specifically, given a list of numbers 1..n, pick numbers randomly from that list (without repetition) until all numbers have been selected. Whenever I have encountered this problem, I have generated a list L containing numbers 1..n, then either
However, I am wondering whether there are any other more nuanced tricks that I have not encountered that don't require an entire list of numbers to be generated. Sorry if this is the wrong place for this question. EDIT: What I'm really interested in is saving space. Specifically, rather than having to store the entire list of n elements, which may not be feasible if n is really large, are there any other space-saving tricks that can be done? For example, off the top of my head, I've had the idea of an algorithm that works as follows; we start with an empty list, and pick the elements at random and store them as they are selected. When we have selected n/2 elements, we go through the list, pick the elements that haven't been selected yet, and put them into a list that we can then probe as in the original algorithm. Saves memory, at the expense of some computational complexity. [link] [comments] |
You are subscribed to email updates from Computer Science: Theory and Application. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment