Integrating GraphLab with Sage

31 views
Skip to first unread message

MM.Brian

unread,
Oct 6, 2010, 4:59:04 AM10/6/10
to sage-devel, grap...@googlegroups.com
GraphLab is a software from Department of Mathematical Science of
Sharif University of Technology written in Java which provides a
comprehensive environment for implementing, visualizing and testing
graph algorithms. The program is available at www.graphlab.sharif.ir

GraphLab’s visualization features and its rich plug-in support make it
a powerful tool for both research and educational purposes. Besides,
it’s an open source application! therefore we aim to add graphlab as
one of the software packages used by sage.

We think we can use GraphLab as a mathematical graph viewer instead of
matplotlib since It provides more features specifically for rendering
graphs in two dimensions. We can also create a GraphViewer java applet
such as Jmol to enable basic edits from a simple GUI or run graphlab
within sage for applying advanced edits and graph operations in a user-
friendly GUI.

What we need to know at the moment is simply where to start from?
any recommendation is appreciated.

MM.Brian

unread,
Oct 6, 2010, 5:08:23 AM10/6/10
to sage-devel
sorry, GraphLab's homepage is http://graphlab.sharif.ir/

Nathann Cohen

unread,
Oct 6, 2010, 8:01:31 AM10/6/10
to sage-devel
Hello !!!

> What we need to know at the moment is simply where to start from?
> any recommendation is appreciated.

Well, for example I did not gather from your message whether you
intend to use GraphLab with Sage for your own needs or whether you
would like to make it available in the standard Sage. In this second
case, you would have to check whether GraphLab's license is GPL-
compatible, and whether Sage can tolerate some java softwares inside
it (I do not know if this is possible, I hope others will answer this
one)

Anyway, if you intend to write some sort of interface between the two,
the best bet may be to read how the interfaces between JMol or the
graphical graph_editor available through Sage's notebook are written
themselves. I remember having read Sage had a generic way to exchange
information with the Notebook, and it may be the key to what you
intend to do !

by the way, when you say "we" : would you happen to be part of
GraphLab's development team ?

Have fun ! :-)

Nathann
Message has been deleted

MM.Brian

unread,
Oct 9, 2010, 4:35:39 PM10/9/10
to sage-devel
> I did not gather from your message whether you intend to use GraphLab with Sage for > your own needs or whether you would like to make it available in the standard Sage.

we would like to integrate GraphLab with Sage similar to how Jmol
does. anyway, we are not yet clear about how to achieve this therefore
we appreciate your suggestions.

> by the way, when you say "we" : would you happen to be part of
> GraphLab's development team ?

I'm an undergraduate CS student and I've recently joined GraphLab
developers' team. the project started about 4 years ago. this summer,
new members joined the team with new developing plans and ideas. it is
now actively under development.

MM.Brian

unread,
Oct 9, 2010, 4:51:23 PM10/9/10
to sage-devel, grap...@googlegroups.com

> Sage ships with a JavaScript based graph editor written by Radoslav Kirov.

thanks, I'm new to sage I didn't know about this editor. well, I found
it very simple offering basic edits. it is useful for modifying small
graphs and it has a good performance but it's not comparable to
GraphLab! GraphLab offers much more advanced features such as
visualizations, algorithms, graph generators, graph reports (property
checkers), subgraph selection and so on and so forth.

> If GraphLab is licensed under an open source license, please clearly state so on the > project's website.

you are right, sorry about the website design, we have planed to
imporve it in the near future.

> Note that matplotlib is used for 2D and 3D visualization not just
> of plots, histograms, scatterplots, etc., but also for lots of things
> amenable to being visualized.

I'm totally aware that matplotlib is used for different visualization
purposes and not just graphs, what I intended to say was that graphlab
can offer better visualization particularly for graphs.
I agree with what you said about platform dependencies and this
difference between Jmol and matplotlib. personally, I think that
having such a feature like GraphLab in sage worths dealing with its
dependencies. beginners can easily figure this out with a well-made
instruction manual.


Thank you so much for your guidance. we're gonna take these options
into account and we will definitly contact you for your further
advices.

On Oct 7, 5:55 am, Minh Nguyen <nguyenmi...@gmail.com> wrote:
> Hi,
>
> On Wed, Oct 6, 2010 at 7:59 PM, MM.Brian <mohsen.br...@gmail.com> wrote:
> > GraphLab’s visualization features and its rich plug-in support make it
> > a powerful tool for both research and educational purposes.
>
> Sage ships with a JavaScript based graph editor written by Radoslav
> Kirov. All you need to do is load up the Sage GUI and study some
> examples in the module
>
> sage/graphs/graph_editor.py
>
> But I see that GraphLab also offers animation (of graph algorithms, I
> assume). That's awesome to have, especially when teaching an
> introductory course in graph theory. An image is worth a thousand
> words, but an animation is priceless.
>
> > Besides,
> > it’s an open source application!
>
> If GraphLab is licensed under an open source license, please clearly
> state so on the project's website [1]. It was only after some
> time-consuming digging that I realized that GraphLab is licensed under
> the GPLv2 [2] and possibly also under LGPL v2.1 [3]. A golden rule of
> website design is: Don't make your user think or do a lot of work to
> get any information relevant to a beginner.
>
> > therefore we aim to add graphlab as
> > one of the software packages used by sage.
>
> You have three options in how you can package up GraphLab for Sage.
>
> (1) As a contributed package. A contributed spkg is, as its name
> suggests, a package for Sage that is contributed by users. The Sage
> project takes no active role in maintaining a contributed spkg. You
> are responsible for its maintenance. However, the Sage project can
> offer you hosting space for your contributed spkg. See the contributed
> spkg page [4] for a list of contributed spkg's. Note that the header
> of that page should be "Sage Contributed Packages", not "Sage
> Experimental Packages". The Sage website maintainers (including me)
> need to update the Sage website and documentation about this.
>
> (2) As an optional spkg. An optional spkg should pass a minimum set of
> hurdles before becoming an optional spkg. For example, it must build
> and run on some platforms that Sage builds and runs on. Like a
> contributed spkg, you take most of the responsibility in maintaining
> an optional spkg. In addition, you need to find at least one Sage
> developer who is willing to review your optional spkg before it can be
> hosted on the optional spkg page [5] of the Sage website. Furthermore,
> someone must be willing to step up to maintain that optional spkg for
> at least a few years. The Sage Development Team already has its hands
> full with nearly 100 different components that are shipped by default
> with Sage. Again, the Sage project can offer hosting space for your
> optional spkg.
>
> (3) As a standard spkg. A standard spkg is a package that is shipped
> by default with each Sage binary and source distribution. The criteria
> for a package to becoming a standard spkg are very strict. Like an
> optional spkg, someone must be willing to step up to maintain a
> standard spkg for at least a few years. Other hurdles dictate that a
> standard spkg must build on some common Linux operating systems, on
> Mac OS X, on (Open)Solaris, and Windows (via Cygwin). See this [7]
> chapter of the Sage Developer's Guide for more information on criteria
> for standard spkg's. See the standard spkg page [6] for a list of
> components that are shipped by default with Sage.
>
> > We think we can use GraphLab as a mathematical graph viewer instead of
> > matplotlib since It provides more features specifically for rendering
> > graphs in two dimensions. We can also create a GraphViewer java applet
> > such as Jmol to enable basic edits from a simple GUI or run graphlab
> > within sage for applying advanced edits and graph operations in a user-
> > friendly GUI.
>
> Note that matplotlib [8] is used for 2D and 3D visualization not just
> of plots, histograms, scatterplots, etc., but also for lots of things
> amenable to being visualized. As you hinted above, Sage does use
> matplotlib for drawing combinatorial graphs. Building and installing
> matplotlib on a wide range of platforms including Linux, Mac OS X,
> (Open)Solaris, and Windows is almost next to painless in my
> experience. Compare that to building and installing JMol on all of the
> above platforms. A lot of problems with using JMol from Sage have been
> about installing the correct Java libraries, e.g. JRE. But it can be
> very tricky for beginning Sage users (not including developers) to
> figure out which Java libraries to install. In light of this, I don't
> see GraphLab becoming a standard spkg in the near future. But that
> doesn't mean I'm against using GraphLab. On the contrary,
> visualization and animation in mathematics education is one of my
> hobby topics. It's just that a beginning user already has a hard time
> figuring out how to use a new piece of software. I personally just
> don't want them to go through the extra task of figuring out
> dependencies. Of course, I'm open to any argument you might have about
> distributing GraphLab as a standard, optional, or contributed spkg.
>
> > What we need to know at the moment is simply where to start from?
> > any recommendation is appreciated.
>
> See the Sage Developer's Guide [9], especially the section with the
> title "Disseminating Code for Sage".
>
> Please inform us of any question you have regarding the Developer's
> Guide or Sage development.
>
> [1]http://graphlab.sharif.ir
>
> [2]http://graphlab.sharif.edu/trac/browser/branches/src/GPL
>
> [3]http://graphlab.sharif.edu/trac/browser/branches/src/LGPL
>
> [4]http://www.sagemath.org/packages/experimental/
>
> [5]http://www.sagemath.org/packages/optional/
>
> [6]http://www.sagemath.org/packages/standard/
>
> [7]http://www.sagemath.org/doc/developer/inclusion.html
>
> [8]http://matplotlib.sourceforge.net
>
> [9]http://www.sagemath.org/doc/developer/
>
> --
> Regards
> Minh Van Nguyen

Jason Grout

unread,
Oct 9, 2010, 8:16:06 PM10/9/10
to sage-...@googlegroups.com
On 10/9/10 3:35 PM, MM.Brian wrote:
>> I did not gather from your message whether you intend to use GraphLab with Sage for> your own needs or whether you would like to make it available in the standard Sage.
>
> we would like to integrate GraphLab with Sage similar to how Jmol
> does. anyway, we are not yet clear about how to achieve this therefore
> we appreciate your suggestions.


It sounds like you could easily visualize a graph. Make a new method
for graphs that prints out the necessary html code to display the graph
in the notebook in GraphLab. Having GraphLab communicate changes back
to Sage (to change the graph) is more complicated, but doable (as you
can see from the simple javascript editor).

So I think the big question is: can you write a function which takes a
Sage graph and prints out the html code needed to display the graph in
GraphLab?

Thanks,

Jason

MM.Brian

unread,
Oct 13, 2010, 4:06:30 PM10/13/10
to sage-devel
Currently, we do not have an applet version of GraphLab but we are
working on it as well as studying how Jmol integrates with sage. so I
guess the answer to this big question is yes, but maybe not in the
near future.

On Oct 10, 3:16 am, Jason Grout <jason-s...@creativetrax.com> wrote:
> On 10/9/10 3:35 PM, MM.Brian wrote:
>
> >> I did not gather from your message whether you intend to useGraphLabwith Sage for>  your own needs or whether you would like to make it available in the standard Sage.
>
> > we would like to integrateGraphLabwith Sage similar to how Jmol
> > does. anyway, we are not yet clear about how to achieve this therefore
> > we appreciate your suggestions.
>
> It sounds like you could easily visualize a graph.  Make a new method
> for graphs that prints out the necessary html code to display the graph
> in the notebook inGraphLab.  HavingGraphLabcommunicate changes back

Jason Grout

unread,
Oct 13, 2010, 10:22:39 PM10/13/10
to sage-...@googlegroups.com
On 10/13/10 3:06 PM, MM.Brian wrote:
> Currently, we do not have an applet version of GraphLab but we are
> working on it as well as studying how Jmol integrates with sage. so I
> guess the answer to this big question is yes, but maybe not in the
> near future.

Jmol has an applet and a standalone version. The applet version works
like I mentioned in a previous message.

To make a standalone GraphLab work, maybe the easiest thing to do is to
write a function which saves a graph into a format that GraphLab can
read, and then launches GraphLab to open that file.

Thanks,

Jason

jason...@creativetrax.com

unread,
Jun 22, 2011, 1:48:31 PM6/22/11
to rostam, sage-devel
On 6/22/11 3:27 AM, rostam wrote:
> I am a main developer of GraphLab.
> We found out finally these different approaches for integration after
> discussion.
>
> 1. The simplest one is to run a GraphLab instance on the user PC, when
> he/she type some command like edit_with_graphlab.
> 2. To make an applet version of GraphLab. It needs much effort to be
> done, also we are not sure about the good efficiency as GraphLab is
> not a lightweight project.
> 3. Converting the GraphLab GUI part to Javascript code step by step.
> We need to connect to other parts of GraphLab (Model and Control)
> remotely.

>
> Please discuss your idea about these approaches.

Any one of these would work, so I guess the question is how much
development effort you have to put into it. It certainly would be easy
to do (1), given that GraphLab was installed.

I'm CCing sage-devel, where other people may also have comments.

Thanks,

Jason

--
Jason Grout

Reply all
Reply to author
Forward
0 new messages