new graph algorithms

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

new graph algorithms

demarey
Hi,

A few days ago, I added new graph algorithms into MooseAlgos but I did not communicate about that.
I added 2 complementary algorithms:
- MalGraphReducer : it takes as input a graph and ouputs a graph without circuits. Nodes forming a circuit (or cycle if you prefer) are merged into a single node. A merge node has a reference to merged nodes. It uses the MalTarjan algorithm.
- MalTopologicalSorting : the well known graph sorting algorithm that can only be applied on graphs without circuits (cycles).

the latter could be useful for some layouting strategies of graphs for example.

Regards,
Christophe.
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: new graph algorithms

abergel
Hi!

Can you provide some (graphical) illustrations about the graph algo?

I know that Moose has some, but they are presented in a very cryptic way.

Graph algos are very important, and we are seriously under-using them.

Cheers,
Alexandre


> On Apr 8, 2015, at 12:53 PM, Christophe Demarey <[hidden email]> wrote:
>
> Hi,
>
> A few days ago, I added new graph algorithms into MooseAlgos but I did not communicate about that.
> I added 2 complementary algorithms:
> - MalGraphReducer : it takes as input a graph and ouputs a graph without circuits. Nodes forming a circuit (or cycle if you prefer) are merged into a single node. A merge node has a reference to merged nodes. It uses the MalTarjan algorithm.
> - MalTopologicalSorting : the well known graph sorting algorithm that can only be applied on graphs without circuits (cycles).
>
> the latter could be useful for some layouting strategies of graphs for example.
>
> Regards,
> Christophe._______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: new graph algorithms

demarey
hi,

Le 8 avr. 2015 à 17:59, Alexandre Bergel a écrit :

> Hi!
>
> Can you provide some (graphical) illustrations about the graph algo?

I added 2 examples method on the MalGraphReducer class to easily display the graph with roassal but the default layouting is not very good. The best I got was with the circle layout.
Here is the graph I gave as input to the graph reducer:

and the output:



With the same input graph, the MalToplogicalSorting gives this result: #($h #($f $d $e $b) $i $a $g $c).

Cheers,
Christophe.


>
> I know that Moose has some, but they are presented in a very cryptic way.
>
> Graph algos are very important, and we are seriously under-using them.
>
> Cheers,
> Alexandre
>
>
>> On Apr 8, 2015, at 12:53 PM, Christophe Demarey <[hidden email]> wrote:
>>
>> Hi,
>>
>> A few days ago, I added new graph algorithms into MooseAlgos but I did not communicate about that.
>> I added 2 complementary algorithms:
>> - MalGraphReducer : it takes as input a graph and ouputs a graph without circuits. Nodes forming a circuit (or cycle if you prefer) are merged into a single node. A merge node has a reference to merged nodes. It uses the MalTarjan algorithm.
>> - MalTopologicalSorting : the well known graph sorting algorithm that can only be applied on graphs without circuits (cycles).
>>
>> the latter could be useful for some layouting strategies of graphs for example.
>>
>> Regards,
>> Christophe._______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

complex-cycle-graph2-reduced.png (38K) Download Attachment
complex-cycle-graph2.png (13K) Download Attachment
smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: new graph algorithms

abergel
Hi!

This is great!!

I have improved a bit your scripts. For example:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| graphReducer view |
graphReducer := MalGraphReducer new.
MalGraphFixture complexCycleGraph2: graphReducer.
graphReducer run.

view := RTMondrian new.
view shape rectangle 
withText: [:n| n model printString].
view nodes: graphReducer nodes.

view shape 
arrowedLine 
color: (Color gray alpha: 0.5).
view shape shortestDistanceAttachPoint.
view edges
moveBehind;
objects: graphReducer nodes from: #yourself toAll: #nextNodes.

view layout forceWithCharge: -3000.
^ view
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The produced graphs are now:

This leads to an interesting points. Where should we put these examples? 
Examples are crucially missing in Moose. 

I could create an example browser that is hooked into the roassal example world menu. Opinion on this?

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Apr 9, 2015, at 7:51 AM, Christophe Demarey <[hidden email]> wrote:

hi,

Le 8 avr. 2015 à 17:59, Alexandre Bergel a écrit :

Hi!

Can you provide some (graphical) illustrations about the graph algo?

I added 2 examples method on the MalGraphReducer class to easily display the graph with roassal but the default layouting is not very good. The best I got was with the circle layout.
Here is the graph I gave as input to the graph reducer:
<complex-cycle-graph2-reduced.png>and the output:<complex-cycle-graph2.png>


With the same input graph, the MalToplogicalSorting gives this result: #($h #($f $d $e $b) $i $a $g $c).

Cheers,
Christophe.



I know that Moose has some, but they are presented in a very cryptic way.

Graph algos are very important, and we are seriously under-using them.

Cheers,
Alexandre


On Apr 8, 2015, at 12:53 PM, Christophe Demarey <[hidden email]> wrote:

Hi,

A few days ago, I added new graph algorithms into MooseAlgos but I did not communicate about that.
I added 2 complementary algorithms:
- MalGraphReducer : it takes as input a graph and ouputs a graph without circuits. Nodes forming a circuit (or cycle if you prefer) are merged into a single node. A merge node has a reference to merged nodes. It uses the MalTarjan algorithm.
- MalTopologicalSorting : the well known graph sorting algorithm that can only be applied on graphs without circuits (cycles).

the latter could be useful for some layouting strategies of graphs for example.

Regards,
Christophe._______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: new graph algorithms

abergel
In reply to this post by demarey
Hi!

This is great!!

I have improved a bit your scripts. For example:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| graphReducer view |
graphReducer := MalGraphReducer new.
MalGraphFixture complexCycleGraph2: graphReducer.
graphReducer run.

view := RTMondrian new.
view shape rectangle 
withText: [:n| n model printString].
view nodes: graphReducer nodes.

view shape 
arrowedLine 
color: (Color gray alpha: 0.5).
view shape shortestDistanceAttachPoint.
view edges
moveBehind;
objects: graphReducer nodes from: #yourself toAll: #nextNodes.

view layout forceWithCharge: -3000.
^ view
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The produced graphs are now:

This leads to an interesting points. Where should we put these examples? 
Examples are crucially missing in Moose. 

I could create an example browser that is hooked into the roassal example world menu. Opinion on this?

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Apr 9, 2015, at 7:51 AM, Christophe Demarey <[hidden email]> wrote:

hi,

Le 8 avr. 2015 à 17:59, Alexandre Bergel a écrit :

Hi!

Can you provide some (graphical) illustrations about the graph algo?

I added 2 examples method on the MalGraphReducer class to easily display the graph with roassal but the default layouting is not very good. The best I got was with the circle layout.
Here is the graph I gave as input to the graph reducer:
<complex-cycle-graph2-reduced.png>and the output:<complex-cycle-graph2.png>


With the same input graph, the MalToplogicalSorting gives this result: #($h #($f $d $e $b) $i $a $g $c).

Cheers,
Christophe.



I know that Moose has some, but they are presented in a very cryptic way.

Graph algos are very important, and we are seriously under-using them.

Cheers,
Alexandre


On Apr 8, 2015, at 12:53 PM, Christophe Demarey <[hidden email]> wrote:

Hi,

A few days ago, I added new graph algorithms into MooseAlgos but I did not communicate about that.
I added 2 complementary algorithms:
- MalGraphReducer : it takes as input a graph and ouputs a graph without circuits. Nodes forming a circuit (or cycle if you prefer) are merged into a single node. A merge node has a reference to merged nodes. It uses the MalTarjan algorithm.
- MalTopologicalSorting : the well known graph sorting algorithm that can only be applied on graphs without circuits (cycles).

the latter could be useful for some layouting strategies of graphs for example.

Regards,
Christophe._______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: new graph algorithms

SergeStinckwich
In reply to this post by demarey
I can integrate my own graph generators if you want :

http://smalltalkhub.com/#!/~SergeStinckwich/Moose-Algos-Graph-Generators



On Wed, Apr 8, 2015 at 5:53 PM, Christophe Demarey
<[hidden email]> wrote:

> Hi,
>
> A few days ago, I added new graph algorithms into MooseAlgos but I did not communicate about that.
> I added 2 complementary algorithms:
> - MalGraphReducer : it takes as input a graph and ouputs a graph without circuits. Nodes forming a circuit (or cycle if you prefer) are merged into a single node. A merge node has a reference to merged nodes. It uses the MalTarjan algorithm.
> - MalTopologicalSorting : the well known graph sorting algorithm that can only be applied on graphs without circuits (cycles).
>
> the latter could be useful for some layouting strategies of graphs for example.
>
> Regards,
> Christophe.
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>



--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: new graph algorithms

abergel
Question to all:
Would it make sense to have Serge’s package into Moose?

@ Serge: Is your code dependent on Moose? If no, how large is it? Maybe we could add it to Roassal.

Alexandre

> On Apr 9, 2015, at 12:36 PM, Serge Stinckwich <[hidden email]> wrote:
>
> I can integrate my own graph generators if you want :
>
> http://smalltalkhub.com/#!/~SergeStinckwich/Moose-Algos-Graph-Generators
>
>
>
> On Wed, Apr 8, 2015 at 5:53 PM, Christophe Demarey
> <[hidden email]> wrote:
>> Hi,
>>
>> A few days ago, I added new graph algorithms into MooseAlgos but I did not communicate about that.
>> I added 2 complementary algorithms:
>> - MalGraphReducer : it takes as input a graph and ouputs a graph without circuits. Nodes forming a circuit (or cycle if you prefer) are merged into a single node. A merge node has a reference to merged nodes. It uses the MalTarjan algorithm.
>> - MalTopologicalSorting : the well known graph sorting algorithm that can only be applied on graphs without circuits (cycles).
>>
>> the latter could be useful for some layouting strategies of graphs for example.
>>
>> Regards,
>> Christophe.
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>
>
>
> --
> Serge Stinckwich
> UCBN & UMI UMMISCO 209 (IRD/UPMC)
> Every DSL ends up being Smalltalk
> http://www.doesnotunderstand.org/
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev