Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better dot #1007

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

james-d-mitchell
Copy link
Collaborator

This is just a proof of concept, not intended to be merged just yet.

@james-d-mitchell james-d-mitchell added do not merge Label for PR that should not be merged WIP Label for PRs that are Works In Progress (WIP) labels Mar 13, 2024
@james-d-mitchell james-d-mitchell force-pushed the better-dot branch 3 times, most recently from 80f95ff to 9ca10b2 Compare May 10, 2024 12:43
@james-d-mitchell james-d-mitchell removed the WIP Label for PRs that are Works In Progress (WIP) label May 15, 2024
@james-d-mitchell
Copy link
Collaborator Author

This will probably fail until both:

digraphs/graphviz#21

and

digraphs/Digraphs#644

are merged.

@james-d-mitchell
Copy link
Collaborator Author

Here's a badly edited bug that currently exists in this PR and should be fixed before merging:

gap> F := FreeMonoid("c", "d");
<free monoid on the generators [ c, d ]>
gap> AssignGeneratorVariables(F);
#I  Assigned the global variables [ c, d ]
gap> R := ParseRelations([c, d], "c^2=c, dc=d, cd^2=d^2, d^5=d^2");
[ [ c^2, c ], [ d*c, d ], [ c*d^2, d^2 ], [ d^5, d^2 ] ]
gap> S := F / R;
<fp monoid with 2 generators and 4 relations of length 20>
gap> Splash(DotLeftCayleyDigraph(S));
#I  Using GeneratorsOfMonoid not GeneratorsOfSemigroup for the Cayley graph
gap> AsSemigroup(S);
<fp monoid with 2 generators and 4 relations of length 20>
gap> AsSemigroup(IsFpSemigroup, S);
<fp semigroup with 3 generators and 9 relations of length 36>
gap> Splash(DotLeftCayleyDigraph(S));
#I  Using GeneratorsOfMonoid not GeneratorsOfSemigroup for the Cayley graph
gap> S := last2;
<fp monoid with 2 generators and 4 relations of length 20>
gap> Splash(DotLeftCayleyDigraph(S));
#I  Using GeneratorsOfMonoid not GeneratorsOfSemigroup for the Cayley graph
gap> S := last2;
<fp semigroup with 3 generators and 9 relations of length 36>
gap> Splash(DotLeftCayleyDigraph(S));
Error: not well-formed (invalid token) in line 2
... <td align="right" port="port1"><identity ...> ...
gap> Print(DotLeftCayleyDigraph(S))
> ;
//dot
digraph hgn {
	node [shape=circle] node [shape="box"]
	1 [color="#00ff00", label="<identity ...>", style=filled]
	2 [color="#ff00ff", label=c, style=filled]
	3 [color="#007fff", label=d, style=filled]
	4 [label=cd]
	5 [label="d^2"]
	6 [label="d^3"]
	7 [label="d^4"]
	1 -> 1 [color="#00ff00"]
	1 -> 2 [color="#ff00ff"]
	1 -> 3 [color="#007fff"]
	2 -> 2 [color="#00ff00"]
	2 -> 2 [color="#ff00ff"]
	2 -> 3 [color="#007fff"]
	3 -> 3 [color="#00ff00"]
	3 -> 4 [color="#ff00ff"]
	3 -> 5 [color="#007fff"]
	4 -> 4 [color="#00ff00"]
	4 -> 4 [color="#ff00ff"]
	4 -> 5 [color="#007fff"]
	5 -> 5 [color="#00ff00"]
	5 -> 5 [color="#ff00ff"]
	5 -> 6 [color="#007fff"]
	6 -> 6 [color="#00ff00"]
	6 -> 6 [color="#ff00ff"]
	6 -> 7 [color="#007fff"]
	7 -> 7 [color="#00ff00"]
	7 -> 7 [color="#ff00ff"]
	7 -> 5 [color="#007fff"]
// legend context
	node [shape=plaintext]
subgraph legend {
	head [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0">
<tr><td align="right" port="port1"><identity ...>&nbsp;</td></tr>
<tr><td align="right" port="port2">c&nbsp;</td></tr>
<tr><td align="right" port="port3">d&nbsp;</td></tr>
</table>>
]
	tail [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0">
<tr><td align="right" port="port1">&nbsp;</td></tr>
<tr><td align="right" port="port2">&nbsp;</td></tr>
<tr><td align="right" port="port3">&nbsp;</td></tr>
</table>>
]
	head:port1:e
	tail:port1:w
	head:port1:e -> tail:port1:w [color="#00ff00", constraint=false]
	head:port2:e
	tail:port2:w
	head:port2:e -> tail:port2:w [color="#ff00ff", constraint=false]
	head:port3:e
	tail:port3:w
	head:port3:e -> tail:port3:w [color="#007fff", constraint=false]
}
	node [shape=circle] node [shape="box"]

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Label for PR that should not be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants