Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Augmenting and reducing data structures

by perlfan (Vicar)
on Apr 22, 2021 at 17:13 UTC ( [id://11131607]=note: print w/replies, xml ) Need Help??


in reply to Augmenting and reducing data structures

This is certainly an interesting question. Your data structure is similar to a finite automata, basically a "state" (or node) is a key in the graph; the nesting represents the edge, and the values of the keys represents the label of the edge (transition predicate). A DFA is just a graph, although many applications represent them as adjacency matrices.

But if you admit some constraints to what it means to "minimize" or "reduce" your data structure, you may rightly be able to apply some technique of DFA minimization; and in fact leverage all of the other neat concepts attached to FA (again they are just graphs with labeled edges and some notion of a start state and 0 or more end states).

(update) and yes, this is a "compression" type algorthm for using the structure as a truth table. But, an interesting and maybe counter intuitive effect of this compress or minimization, is that the more "dense" a DFA is, the more unweildy the results of reducing it to an equivalent "regular expression" becomes (not the same as the Perl kind, but language description nonetheless). There are algorithms to do this, but they'e far above my paygrade :-)
  • Comment on Re: Augmenting and reducing data structures

Replies are listed 'Best First'.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11131607]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-26 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found