# Tag Info

10

I had an old program lying around that will generate all realizations of a degree sequence. The first vertex will have degree equal to the first element in the input list, the 2nd degree equal to the 2nd element, and so on. The program requires my IGraph/M package for graphicality testing. For details on how it works, see http://bolyai.cs.elte.hu/egres/tr/...

5

4X4 adjacency matrices: am = Tuples[{0, 1}, {4, 4}]; 4X4 adjacency matrices with no self-loops: simpleam = DeleteDuplicates[(1 - IdentityMatrix[4]) # & /@ am]; Adjacency matrices for undirected graphs on 4 nodes: undirectedam = Select[# == Transpose@# &]@simpleam; Adjacency matrices for graphs with vertex degree sequence {1,1,2,2}: vdegree1122am = ...

4

GroupOrbits[CyclicGroup[5], {{1, 1, 2, 3, 3}}, Permute] {{{1, 1, 2, 3, 3}, {1, 2, 3, 3, 1}, {2, 3, 3, 1, 1}, {3, 1, 1, 2, 3}, {3, 3, 1, 1, 2}}}

1

A one-liner: Length@Select[Graph /@ Subsets[EdgeList[CompleteGraph[4]]], Sort@VertexDegree[#] == {1, 1, 2, 2} &] EdgeList[CompleteGraph[4]] will give us all the possible edges on four vertices, Subsets will give us all the possible subsets of those edges, and Graph will turn those into graphs. (When a vertex is isolated, it will not be included in the ...

1

After some clarification I think an orbit in the sense explained above can be found by repeating a right or left rotation n-1 times where n is the length of the list. This may produce identical lists (e.g. {1,2,1,2} shifted twice), therefore, we must weed out the duplicates, what can be done by DeleteDuplicates: n = 5; DeleteDuplicates[NestList[RotateRight, {...

Only top voted, non community-wiki answers of a minimum length are eligible