Lazarus

Free Pascal => General => Topic started by: dgaspary on July 09, 2014, 07:27:43 pm

Title: Graphs - Data structure (not graphics)
Post by: dgaspary on July 09, 2014, 07:27:43 pm
Hi.

Is there (maybe at FCL) this type of data structure and its algorithms?

Lazarus seems to have now some Graphs objects at LvlGraphCtrl Unit.

But they are related to LCL controls.

Thank you.
Title: Re: Graphs - Data structure (not graphics)
Post by: Leledumbo on July 10, 2014, 10:04:04 am
On my to do list, currently I've only implemented k-ary tree with depth & breadth first: http://svn.freepascal.org/svn/fpc/trunk/packages/fcl-stl/src/gtree.pp
Actually, I should've implemented graph in the first place, then make tree as a special case of graph. My knowledge is a bit weak on graph, though. I only got B- on the respective programming subject and even C (on the second attempt, first attempt was D) on the respective mathematical subject. There are just too many graph traversal algorithm...
Title: Re: Graphs - Data structure (not graphics)
Post by: dgaspary on July 10, 2014, 02:12:29 pm
On my to do list, currently I've only implemented k-ary tree with depth & breadth first: http://svn.freepascal.org/svn/fpc/trunk/packages/fcl-stl/src/gtree.pp
Actually, I should've implemented graph in the first place, then make tree as a special case of graph. My knowledge is a bit weak on graph, though. I only got B- on the respective programming subject and even C (on the second attempt, first attempt was D) on the respective mathematical subject. There are just too many graph traversal algorithm...

I will take a look when I have some time. Thank you.
Title: Re: Graphs - Data structure (not graphics)
Post by: Basile B. on July 12, 2014, 04:02:30 pm
You have an AVL tree somewhere in the FCL.
Title: Re: Graphs - Data structure (not graphics)
Post by: avra on September 02, 2019, 06:36:23 pm
I also need graph data structure so I would like to know if there is anything new on this matter in FreePascal?
Title: Re: Graphs - Data structure (not graphics)
Post by: Thaddy on September 02, 2019, 06:41:11 pm
You have an AVL tree somewhere in the FCL.
In RTL-generics....Not FCL.
Title: Re: Graphs - Data structure (not graphics)
Post by: lucamar on September 02, 2019, 06:45:51 pm
You have an AVL tree somewhere in the FCL.
In RTL-generics....Not FCL.

There is one also in the FCL, in the unit: AVL_Tree
Title: Re: Graphs - Data structure (not graphics)
Post by: julkas on September 02, 2019, 06:47:33 pm
I also need graph data structure so I would like to know if there is anything new on this matter in FreePascal?
Check - https://github.com/avk959/LGenerics
Title: Re: Graphs - Data structure (not graphics)
Post by: avra on September 03, 2019, 12:15:29 am
I also need graph data structure so I would like to know if there is anything new on this matter in FreePascal?
Check - https://github.com/avk959/LGenerics
Thanks!  :D
Title: Re: Graphs - Data structure (not graphics)
Post by: julkas on September 03, 2019, 10:08:50 am
Also (if you know Python) take a look here - https://github.com/ufkapano/graphs-dict
Title: Re: Graphs - Data structure (not graphics)
Post by: zamtmn on September 03, 2019, 10:23:07 am
https://github.com/zamtmn/zcad/tree/master/cad_source/other/AGraphLaz
Old and powerful graph lib
Title: Re: Graphs - Data structure (not graphics)
Post by: zamtmn on September 03, 2019, 11:02:45 am
Quote
Thanks but you did not read topic carefull enough. I was not looking for visual graphs, but for implementation of graph data structure explained here: https://en.wikipedia.org/wiki/Graph_(abstract_data_type)
This is not a visual library, only the implementation of graphs and algorithms over them.  See examples https://github.com/zamtmn/zcad/tree/master/cad_source/other/AGraphLaz/Test/Graph
Title: Re: Graphs - Data structure (not graphics)
Post by: avra on September 03, 2019, 11:08:47 am
@zamtmn:
I did not look deeper as I probably should have. I deleted the post before I saw that you have already replied. I apologize for the inconvenience I made.

@all:
I have added LGenerics to the wiki page and mentioned that it supports graphs:
https://wiki.freepascal.org/Data_Structures,_Containers,_Collections
Title: Re: Graphs - Data structure (not graphics)
Post by: zamtmn on September 03, 2019, 11:25:09 am
avra
No problem.
Once upon a time I found this library. It is really powerful and convenient, implements many different mathematical algorithms. With the author I could not contact, all are very old contacts. I fixed some bugs related to 64 bit systems, and posted on github.
The only bad place is that the library was written long before the generics. And uses different hacks to implement generics functionality
Title: Re: Graphs - Data structure (not graphics)
Post by: jamie on September 03, 2019, 06:03:18 pm
Don't worry about not using generics, the only think you are missing is the bloat that comes with it.

 These are my own opinions of course from the peanut gallery.
Title: Re: Graphs - Data structure (not graphics)
Post by: avk on September 13, 2019, 06:49:32 pm
@Avra, I think this is somewhat premature, but thanks anyway.
@zamtmn, maybe you should also add a link to your library on the wiki? And it would be interesting someday to compare the capabilities and performance of both libraries.
@jamie, I believe that programs are not bloated by libraries, but by programmers who copy the entire(dynamic)
array when they need to read only three consecutive values from this array.
Title: Re: Graphs - Data structure (not graphics)
Post by: zamtmn on September 13, 2019, 08:04:52 pm
This isn't my library.
>>Copyright (C) Alexey A. Chernobaev, 1996-2003
I couldn't find the author, it's been a long time. I do not know analogues of this library, it implements not just a tree container, this is a full implementation of graphs and algorithms over them. For example - finding the shortest path
Title: Re: Graphs - Data structure (not graphics)
Post by: avk on September 13, 2019, 08:43:06 pm
Well, does it probably have any license?
Title: Re: Graphs - Data structure (not graphics)
Post by: zamtmn on September 13, 2019, 08:48:51 pm
https://github.com/zamtmn/zcad/blob/master/cad_source/other/AGraphLaz/LICENSE the license is only for one part of the library, that's all the author left us
Title: Re: Graphs - Data structure (not graphics)
Post by: avk on September 14, 2019, 07:39:39 am
Yes, I have read it. I am not a lawyer, but it seems that there is nothing that would prohibit you from distributing this library under any kind of permissive license, provided that authorship is preserved. Or did I understand something wrong?
Title: Re: Graphs - Data structure (not graphics)
Post by: avra on September 14, 2019, 08:43:01 am
I am not a lawyer, but it seems that there is nothing that would prohibit you from distributing this library under any kind of permissive license, provided that authorship is preserved. Or did I understand something wrong?
You can not change the license of the library, it stays MPL. You can mix it with other source code without making it viral to your code. I might be wrong, so better check this:
https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)
Title: Re: Graphs - Data structure (not graphics)
Post by: julkas on September 14, 2019, 10:57:41 am
I found this (in Russian) -
http://176.102.48.88/ftp/kabinet/info/%D0%9D%D0%B0%20%D0%B4%D0%BE%D0%BF%D0%BE%D0%BC%D0%BE%D0%B3%D1%83%20%D0%B2%D1%87%D0%B8%D1%82%D0%B5%D0%BB%D1%8E%20%D1%96%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%82%D0%B8%D0%BA%D0%B8/BOOK/Book_algo/book-html/graf.algo.server/www/

http://176.102.48.88/ftp/kabinet/info/%D0%9D%D0%B0%20%D0%B4%D0%BE%D0%BF%D0%BE%D0%BC%D0%BE%D0%B3%D1%83%20%D0%B2%D1%87%D0%B8%D1%82%D0%B5%D0%BB%D1%8E%20%D1%96%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%82%D0%B8%D0%BA%D0%B8/BOOK/Book_algo/book-html/graf.algo.server/www/index-1.htm

http://graph-software.narod.ru/main.html
TinyPortal © 2005-2018