I
Igor Planinc
Developing a graph (read: vertex-edge thingy) application I have some decisions
to make and I'd appreciate some thoughts on a couple of ... issues.
I'd like to store (into SQL) generated graphs, including their "properties" like
colourings, various cycles etc. Graphs are simple (no multiple edges nor loops)
and undirected and therefore their structural data can be stored in (halfs of)
adjacency matrices (or adjacency lists) with 0/1 values. I would also like those
graphs to be quickly retrievable (utilizing an SQL index). As various SQL
servers pose restrictions onto sizes of "indexable" fields (MySQL, for example,
had 255 char limitation not long ago) I was thinking of computing
graph-structure digests and make SQL indices on those.
Now, I'd like to calculate digests using a DigestOutputStream
(constructor: DigestOutputStream(OutputStream stream, MessageDigest digest)), so
I need:
1. Something like BitOutputStream (to pass as s first argument into above
constructor) which implements, say, writeBit(int) or write(boolean). I'd also
use such a stream for "serializing" graphs' structural data. I'd also need
BitInputStream for "deserializing". I found JFAC's implementation but haven't
tested it, yet. Also: are there any other available (noncommercial)
implementations out there? Any thoughts on possible (bit-wise) endian issues?
2. As safe (collision-wise) as possible implementation of MessageDigest limited
to 255 bytes (or 127, if I decide to store hex notation) computable reasonably
fast. And of course implemented in Java, preferably Sun spi in their jre. Does
anyone have any experience with those?
I'd appreciate any insight.
to make and I'd appreciate some thoughts on a couple of ... issues.
I'd like to store (into SQL) generated graphs, including their "properties" like
colourings, various cycles etc. Graphs are simple (no multiple edges nor loops)
and undirected and therefore their structural data can be stored in (halfs of)
adjacency matrices (or adjacency lists) with 0/1 values. I would also like those
graphs to be quickly retrievable (utilizing an SQL index). As various SQL
servers pose restrictions onto sizes of "indexable" fields (MySQL, for example,
had 255 char limitation not long ago) I was thinking of computing
graph-structure digests and make SQL indices on those.
Now, I'd like to calculate digests using a DigestOutputStream
(constructor: DigestOutputStream(OutputStream stream, MessageDigest digest)), so
I need:
1. Something like BitOutputStream (to pass as s first argument into above
constructor) which implements, say, writeBit(int) or write(boolean). I'd also
use such a stream for "serializing" graphs' structural data. I'd also need
BitInputStream for "deserializing". I found JFAC's implementation but haven't
tested it, yet. Also: are there any other available (noncommercial)
implementations out there? Any thoughts on possible (bit-wise) endian issues?
2. As safe (collision-wise) as possible implementation of MessageDigest limited
to 255 bytes (or 127, if I decide to store hex notation) computable reasonably
fast. And of course implemented in Java, preferably Sun spi in their jre. Does
anyone have any experience with those?
I'd appreciate any insight.