lamp={{a,0}{a,1},{a,1}{b,0},{b,1}{a,1},{b,0}{b,0}};
{1,0,0,1,0}
ApplyGr[s_,seq_]:=FoldList[{First[#1],#2}/.lamp&,{s},seq]
ApplyGr[a,{1,0,1,0,0,1}]
{{a},{b,0},{b,0},{a,1},{a,1},{a,1},{b,0}}
ApplyGrSymbols[s_,seq_]:=Last/@Rest[ApplyGr[s,seq]]
FromDigits[#,2]&/@Table[ApplyGrSymbols[a,IntegerDigits[i,2]],{i,1000}];
ListPlot[%]
⁃Graphics⁃
FromDigits[#,2]&/@Table[ApplyGrSymbols[b,IntegerDigits[i,2]],{i,1000}];
ListPlot[%]
⁃Graphics⁃
FromDigits[#,2]&/@Table[ApplyGrSymbols[b,IntegerDigits[i,2]],{i,10}]
{1,3,2,7,6,4,5,15,14,12}
Range[10]
{1,2,3,4,5,6,7,8,9,10}
Range[10]
With[{s=4},Transpose[{Range[Length[#]]-1,#}&[FromDigits[#,2]&/@Table[ApplyGrSymbols[b,Rest[IntegerDigits[i,2]]],{i,0,2^s}]]]]
{{0,0},{1,0},{2,0},{3,1},{4,0},{5,1},{6,3},{7,2},{8,0},{9,1},{10,3},{11,2},{12,7},{13,6},{14,4},{15,5},{16,0}}
<<DiscreteMath`Combinatorica`
CompleteGraph[3]
⁃Graph:<3, 3, Undirected>⁃
InputForm[%]
Graph[{{{1, 2}}, {{1, 3}}, {{2, 3}}}, {{{-0.4999999999999998, 0.8660254037844387}},
{{-0.5000000000000004, -0.8660254037844384}}, {{1., 0}}}]
{{-0.5000000000000004, -0.8660254037844384}}, {{1., 0}}}]
FromAdjacencyLists[%41]//InputForm
FromAdjacencyLists[{{{0, 0}, {1, 0}, {2, 0}, {3, 1}, {4, 0}, {5, 1}, {6, 3}, {7, 2}, {8, 0},
{9, 1}, {10, 3}, {11, 2}, {12, 7}, {13, 6}, {14, 4}, {15, 5}, {16, 0}}}]
{9, 1}, {10, 3}, {11, 2}, {12, 7}, {13, 6}, {14, 4}, {15, 5}, {16, 0}}}]
ShowGraph[FromAdjacencyLists[%41]]
⁃Graphics⁃
?FromAdjacencyLists
FromAdjacencyLists[l] constructs an edge list representation for a graph from the given adjacency lists l, using a circular embedding. FromAdjacencyLists[l, v] uses v as the embedding for the resulting graph. An option called Type that takes on the values Directed or Undirected can be used to affect the type of graph produced. The default value of Type is Undirected.
ShowGraph[SpringEmbedding[Graph[{%41}]]]
Table::iterb:Iterator {DiscreteMath`Combinatorica`Private`i,V[Graph[{{{0,0},{1,0},{2,0},12,{15,5},{16,0}}}]]} does not have appropriate bounds.
Join::heads:Heads DiscreteMath`Combinatorica`Private`Double and Table at positions 1 and 2 are expected to be the same.
Join::heads:Heads DiscreteMath`Combinatorica`Private`Double and Table at positions 1 and 2 are expected to be the same.
Table::iterb:Iterator {DiscreteMath`Combinatorica`Private`i,V[Graph[{{0,0,0,1,0,1,3,2,0,1,3,2,7,6,4,5,0}}]]} does not have appropriate bounds.
Join::heads:Heads DiscreteMath`Combinatorica`Private`Double and Table at positions 1 and 2 are expected to be the same.
General::stop:Further output of Join::heads will be suppressed during this calculation.
Table::iterb:Iterator {V[Graph[{{{0,0},{1,0},{2,0},{3,1},{4,0},{5,1},6,{12,7},{13,6},{14,4},{15,5},{16,0}}}]]} does not have appropriate bounds.
General::stop:Further output of Table::iterb will be suppressed during this calculation.
Part::pspec:Part specification V[Graph[{{0,0,0,1,0,1,3,2,0,1,3,2,7,6,4,5,0}}]] is neither an integer nor a list of integers.
Set::pspec:Part specification V[Graph[{{0,0,0,1,0,1,3,2,0,1,3,2,7,6,4,5,0}}]] is neither an integer nor a list of integers.
CompiledFunction::cfta:Argument {Table[0,{V[Graph[{{{0,0},{1,0},{2,0},{3,1},{4,0},8,{13,6},{14,4},{15,5},{16,0}}}]]}],1} at position 3 should be a rank 2 tensor of machine-size integers.
CompiledFunction::cfta:Argument {Table[0,{V[Graph[{{{0,0},{1,0},{2,0},{3,1},{4,0},8,{13,6},{14,4},{15,5},{16,0}}}]]}],1} at position 2 should be a rank 2 tensor of machine-size integers.
Part::partw:Part 2 of Vertices[Graph[{{{0,0},{1,0},{2,0},{3,1},{4,0},7,{12,7},{13,6},{14,4},{15,5},{16,0}}}]] does not exist.
Part::partw:Part 2 of Vertices[Graph[{{{0,0},{1,0},{2,0},{3,1},{4,0},7,{12,7},{13,6},{14,4},{15,5},{16,0}}}]] does not exist.
Thread::tdlen:Objects of unequal length in {0.,0.}+-1 cannot be combined.
10.(1-1)(1-V[Graph[{{1}}]])
Max[0.001,2+1-Vertices[1]〚2〛]
Part::partw:Part 2 of Vertices[Graph[{{{0,0},{1,0},{2,0},{3,1},{4,0},7,{12,7},{13,6},{14,4},{15,5},{16,0}}}]] does not exist.
General::stop:Further output of Part::partw will be suppressed during this calculation.
CompiledFunction::cfta:Argument {Table[0,{V[Graph[{{{0,0},{1,0},{2,0},{3,1},{4,0},8,{13,6},{14,4},{15,5},{16,0}}}]]}],1} at position 2 should be a rank 2 tensor of machine-size integers.
General::stop:Further output of CompiledFunction::cfta will be suppressed during this calculation.
Thread::tdlen:Objects of unequal length in 0.+,0.++-1 cannot be combined.
0.-0.253+{1}
1
Max[1]
Max0.001,0.+
2
(1)
0.1
1
1
1
Thread::tdlen:Objects of unequal length in 0.+,0.++{1} cannot be combined.
10.0.-1+1+1
1
1
Max[0.001,2+1+0.({1-1}+1)]
1
1
General::stop:Further output of Thread::tdlen will be suppressed during this calculation.
$Aborted
lamp={{a,0}{a,1},{a,1}{b,0},{b,1}{a,1},{b,0}{b,0}};
Matrix version
Matrix version