More user feedback on Sets.py
David Eppstein
eppstein at ics.uci.edu
Fri Nov 7 18:01:40 EST 2003
In article <1hSqb.1167$bQ3.696 at nwrdny03.gnilink.net>,
"Raymond Hettinger" <vze4rx4y at verizon.net> wrote:
> For Py2.4, I'm working on a C implementation of Sets.py with the possibility
> of
> having a set() type as a builtin. There is a question as whether the current
> design for set of sets has been useful.
>
> To support sets-of-sets, the current design includes an automatic conversion
> to
> an immutable set class. The original use case was for implementing graph
> algorithms.
>
> Has anyone used sets-of-sets to solve any non-toy problems?
> Has anyone successfully applied sets-of-sets to graph algorithms?
> If the need has arisen, is the current design sufficient?
I've certainly been doing some implementations of graph algorithms in
which the graph vertices represent sets of objects (but I've been
representing them as bitvectors since I am still running 2.2 and don't
have Sets.py yet). It would be awkward if I couldn't have sets of
vertices...but I don't see any reason for the sets in these applications
to ever be mutable, so automatic conversion to immutability doesn't seem
to be critical.
For something concrete (that I thought about doing recently but haven't
actually done): conversion of NFA to DFA and then state minimization of
the resulting DFA. The converted DFA's states are sets of states of the
NFA, and the state minimization involves sets of DFA states.
--
David Eppstein http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science
More information about the Python-list
mailing list