tag:blogger.com,1999:blog-5195188167565410449.post4475078732186032477..comments2015-10-31T08:21:47.984+00:00Comments on Haskell for Maths: Some groups and some graphsDavidAhttp://www.blogger.com/profile/16359932006803389458noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-5195188167565410449.post-60257763189323509282009-10-22T03:43:04.399+01:002009-10-22T03:43:04.399+01:00Great, thanks!Great, thanks!schemanhttp://www.blogger.com/profile/12181709786187295956noreply@blogger.comtag:blogger.com,1999:blog-5195188167565410449.post-23190982106456734142009-10-19T21:19:19.629+01:002009-10-19T21:19:19.629+01:00Ah, well in that case, you might be interested to ...Ah, well in that case, you might be interested to know:<br />- HaskellForMaths has code for multivariate polynomials, in Math.Algebra.Commutative.MPoly<br />- I did write code for Polya counting in an earlier version of the HaskellForMaths code, which is described at http://www.polyomino.f2s.com/david/haskell/polyacounting.html<br />- I have ported the core of it to HaskellForMaths, but not yet published.<br /><br />But it's always more fun to work out the code for yourself - so good luck.DavidAhttp://www.blogger.com/profile/16359932006803389458noreply@blogger.comtag:blogger.com,1999:blog-5195188167565410449.post-34296124994683321942009-10-19T00:23:38.928+01:002009-10-19T00:23:38.928+01:00my goal is to study http://en.wikipedia.org/wiki/P...my goal is to study http://en.wikipedia.org/wiki/PĆ³lya_enumeration_theorem<br />with Haskell. For the moment, I have developped a symbolic library to manipulate multivariate polynomials (deriving from Num) for the computation of the cycle index functions Z and I'm browsing your library in search for useful complements.schemanhttp://www.blogger.com/profile/12181709786187295956noreply@blogger.comtag:blogger.com,1999:blog-5195188167565410449.post-86354035618372592202009-10-18T19:32:41.017+01:002009-10-18T19:32:41.017+01:00scheman:
Yes, that code looks safe to me, and seem...scheman:<br />Yes, that code looks safe to me, and seems to work fine. Incidentally, you can replace "(flip (.^) per)" with "(.^ per)".<br />I don't currently have a function to do that. I'm curious to know what you want to use it for. (My guess is that you're searching for non-isomorphic graphs - if so, I have some code in the labs that might interest you.)DavidAhttp://www.blogger.com/profile/16359932006803389458noreply@blogger.comtag:blogger.com,1999:blog-5195188167565410449.post-44485441815969962382009-10-18T08:40:21.732+01:002009-10-18T08:40:21.732+01:00thanks.
by the way, is it safe to design a permuta...thanks.<br />by the way, is it safe to design a permutation-transformed graph by <br /><br />appliedTo :: (Ord a) => Permutation a -> Graph a -> Graph a<br />per `appliedTo` g = let (G vs es) = g in graph (Data.List.sort $ map (flip (.^) per) vs, Data.List.sort $ map (flip (-^) per) es)<br /><br />and is there already a function which does that ?schemanhttp://www.blogger.com/profile/12181709786187295956noreply@blogger.comtag:blogger.com,1999:blog-5195188167565410449.post-84408002235388383092009-10-17T21:25:53.240+01:002009-10-17T21:25:53.240+01:00scheman: Not quite at a glance, but it's still...scheman: Not quite at a glance, but it's still fairly easy. So in the later installments, I explained that graphAuts2 and graphAuts3 return "transversal generating sets", while graphAuts returns a "strong generating set". In both cases, the first thing you need to do is split the generating set into levels: the auts that move 1, those that fix 1 but move 2, those that fix 1 and 2 but move 3, and so on. For example, here's graphAuts dodecahedron, split into levels:<br /><br />[[1,2],[3,5],[6,8],[9,15],[10,14],[11,13],[17,20],[18,19]]<br />[[1,3],[4,5],[6,10],[7,9],[11,15],[12,14],[16,17],[18,20]]<br />[[1,6,15,20,19,18,11,10,3,2],[4,8,5,7,14,16,13,17,12,9]]<br /><br />[[2,5],[3,4],[7,15],[8,14],[9,13],[10,12],[16,20],[17,19]]<br />[[2,6,5],[3,7,14],[4,8,15],[9,20,12],[10,16,13],[11,17,19]]<br /><br />[[3,8],[4,7],[5,6],[9,10],[11,17],[12,16],[13,20],[14,15]]<br /><br />Now, in each level, we need to figure out how many vertices are in the orbit of the base vertex.<br />In the first level, the base vertex is 1. The third of the three auts has a cycle of 10 vertices which can be reached from 1. We just need to see whether we can reach the other 10-cycle. Well, we can, using the first two auts, eg 1 -> 3 (second aut), 3 -> 5 (first aut), and 5 puts us into the second 10-cycle in the third aut.<br />In the second level, the base vertex is 2. The orbit is [2,5,6]. (You can check that neither aut in the second level can take 2 outside this orbit.)<br />In the third level, the orbit is [3,8].<br />So we get 20*3*2 = 120, as expected.DavidAhttp://www.blogger.com/profile/16359932006803389458noreply@blogger.comtag:blogger.com,1999:blog-5195188167565410449.post-42717538155136061772009-10-17T19:14:30.447+01:002009-10-17T19:14:30.447+01:00can you tell us at a glance how many symmetries g ...can you tell us at a glance how many symmetries g has if we show you what "graphAuts g" returns ?schemanhttp://www.blogger.com/profile/12181709786187295956noreply@blogger.com