Graph and network flow algorithms in GoLang

2,074 views
Skip to first unread message

Meir

unread,
Mar 22, 2014, 1:24:53 PM3/22/14
to golan...@googlegroups.com

I am considering switching from C to GoLang in order to write more generic code faster for my research in AI. However, I noticed that the Go standard library is missing algorithms for working with graphs and networks and I am not eager to write my own code for graph partitioning or minimum cost flow -- that would undermine my goal of writing code faster!

I am guessing that the right thing to do could be (is it?) to link against existing C libraries, but I am afraid of the compatibility issues and the associated headache. So, I would appreciate if GoLang programmers could share their experience on this topic. Thanks!

Gyu-Ho Lee

unread,
Mar 22, 2014, 1:43:12 PM3/22/14
to golan...@googlegroups.com
I am glad to find your interest in graph. I don't know much about graph theory but have a huge interest in this field. I have just started building this for the sake of learning. And plan to learn network flow and minimum cost problem over the spring break. (It seems challenging for me, so I might need more reading in this topic).


Oleku Konko

unread,
Mar 22, 2014, 5:30:16 PM3/22/14
to golan...@googlegroups.com
+1  nice

David Skinner

unread,
Mar 22, 2014, 8:17:45 PM3/22/14
to golan...@googlegroups.com
I am not an experienced go programmer but I do have a lot of c and c++ experience. I found the cgo documentation to be sparse but after reading a few of the sample files I am doing quite well with using go to make c calls to c++ libraries and making calls from c++ to go func. It cost me about a week and I may not be proficient but I do okay. Now that I am using it, I would never go back. I like that I can edit my cpp file and run go test and know quickly that all of my code is working as desired. It really is well integrated.

Vincenzo Prignano

unread,
Mar 23, 2014, 6:30:31 AM3/23/14
to golan...@googlegroups.com
I really like your project. Well done, will contribute where I can :)


On Saturday, March 22, 2014 6:43:12 PM UTC+1, Gyu-Ho Lee wrote:

Dan Kortschak

unread,
Mar 23, 2014, 6:58:45 AM3/23/14
to Meir, golan...@googlegroups.com
Jeff Juozapaitis and Sonya Keyes have been putting in a fair amount of
work to the gonum project's graph packages.

http://godoc.org/github.com/gonum/graph

There may also be other packages in that project you may interested in
for your research.

Gyu-Ho Lee

unread,
Mar 24, 2014, 12:28:58 AM3/24/14
to golan...@googlegroups.com
Thanks a lot! I will update more so that I can also visualize the algorithm too.
Reply all
Reply to author
Forward
0 new messages