Imagine I provide you a list of arbitrary strings, say: Map[StringJoin, Tuples[{"0", "1", "2"}, 4]]
. I'd like to abstract these strings as a graph object in Mathematica v9, where each string $s_i$ becomes a vertex $v_i$, and two vertices $(v_a,v_b)$ share an edge if one or more test cases return TRUE
for the two strings. For example, if EditDistance[sa,sb] > 3
is TRUE
and if StringReverse[sa] == sb
is TRUE
, then I'd like the respective vertices $v_a$ and $v_b$ to share an edge.
Once I've performed some graph operation to generate a subgraph of the original graph, I'd like to pull back down the list of strings corresponding to the vertices in this subgraph.
Being new to Mathematica v9's treatment of graphs, what would be the best way to proceed here? Is it at all reasonable to do this for large sets of vertices, $10^5$ or so?