home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!mintaka.lcs.mit.edu!zurich.ai.mit.edu!jaffer
- From: jaffer@zurich.ai.mit.edu (Aubrey Jaffer)
- Newsgroups: sci.math.symbolic
- Subject: Re: fast variable ordering
- Message-ID: <JAFFER.93Jan7115459@camelot.ai.mit.edu>
- Date: 7 Jan 93 16:54:59 GMT
- Sender: news@mintaka.lcs.mit.edu
- Organization: M.I.T. Artificial Intelligence Lab.
- Lines: 49
-
- In article <JAFFER.92Nov28182855@camelot.ai.mit.edu> I wrote:
- >Variable or term orderings are a very common operations in Computer
- >Algebra systems. It makes sense to optimize these comparisons in
- >order to improve system speed.
- >
- >Since in most systems there can be introduced new terms or variables
- >which are in between adjacent existing terms, a naive ordering cannot
- >be accomplished in finite storage. String comparison is not as fast
- >as integer comparison, and even floating point is expensive on older
- >machines.
- >
- >I have been trying to find a dynamic data structure which would allow
- >me to assign integers of a finite range (say 2^29) to variables and
- >terms. I am willing to periodically reassign all of these integers,
- >but not more often than once per hundred term creations.
- >
- >I have looked through several books on data structures and algorithms
- >and have not found an appropriate structure. Can anyone suggest a
- >solution?
-
- Date: Sat, 28 Nov 92 17:58:12 PST
- From: fateman@peoplesparc.Berkeley.EDU (Richard Fateman)
-
- I wrote a paper on doing this by combining a hash table and a tree,
- in ISSAC-91.
-
- I have not gotten a copy of this paper yet. But WHITTEN@FWVA.SAIC.COM
- has sent me a suggestion which I distill as follows:
-
- What he suggests is to store the variables in a binary tree, store the
- decision string in the tree of each element with that element, and use
- this decision string for fast variable comparisons. If the tree
- remains reasonably balanced, 30 bits of decision string (alias
- integer) should be enough for any computation this century.
-
- All the decision strings in a subtree will have to be recomputed
- whenever that subtree is rebalanced, but this is within my
- specifications.
-
- What I acutally did in jacal1a0 is to make a string (of characters) a
- component of each variable. The first character in the string is the
- user settable priority and the rest are from the variable name.
- String comparison is a reasonably fast and some basis for ordering has
- to be maintained with the variable.
-
- At some time in the future the variable comparison acceleration as
- described above can be added onto the existing system by adding an
- integer field to variables and creating a balanced binary tree of
- variables.
-