partition list and enumerating
- To: mathgroup at smc.vnet.net
- Subject: [mg47744] partition list and enumerating
- From: sean_incali at yahoo.com (sean kim)
- Date: Sat, 24 Apr 2004 04:15:51 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
hello group,
this is kinda like a follow up on my last post.
i have a way to enumerate the problem i posted earlier.
I wanted to find all tours that are possible with the edges given. Now
I have to plot them.
consider the following. it will generate 64 lists of edges within a
list.
la= {
"{1, 4}, a",
"{1, 5}, a",
"{4, 2}, a",
"{4, 5}, a",
"{5, 2}, a",
"{5, 4}, a"
};
li ={
"{1, 4}, i",
"{1, 5}, i",
"{4, 2}, i",
"{4, 5}, i",
"{5, 2}, i",
"{5, 4}, i"
};
lai=Outer[List,Sequence@@Transpose[{la,li}]]//Flatten[#,Length[la]-1]&//ToString;
StringReplace[lai,{"a,"\[Rule] "EdgeColor ->
Blue},{","i,"->"EdgeColor-> Red},{", "a"-> "EdgeColor \[Rule] Blue",
"i"->"EdgeColor-> Red"}]//ToExpression;
Partition[%, 6]
%//Length
now what I woudl like to do is use combinatorica to show all 64
enumerations as 64 separate graphs using the same vertices as follows.
{
{{0.0, 1.5}, VertexLabel -> a1},
{{0.0, 0.0}, VertexLabel -> b2},
{{0.5, 0.75}, VertexLabel -> c3},
{{-0.5, 0.75}, VertexLabel -> d4},
{{-1.5, 0.75}, VertexLabel -> e5}
}
how do I do that? at least how do map those vertices to those edge
sets generated by the enueration above so that i canuse in ShowGraph
command?
thanks all very much in adavnce
sean