DEAP GP: individuals with variable number of subtrees.

28 views
Skip to first unread message

RomanT

unread,
May 3, 2025, 12:46:57 PMMay 3
to deap-users
Hi All,

Just discovered DEAP (I'm looking for the means to implement a strongly-typed tree-based GP for a specific problem, and it seems like DEAP is the way to go)!

However, my problem presumes an ability for each individual to have it's own number of subtrees. Conceptually, each subtree represents an 'organ', using which an individual is able to do some things specific to that kind of organ.

There is a minimal set of subtrees (organs) possible for the individual to be correct and viable, there is a maximal set of subtrees (organs) possible: the task is not only in finding the structure of each subtree but also in finding an optimal set of subtrees.

Is it possible to do that with DEAP? May be not out-of-the box, but in general?

Thank you.

François-Michel De Rainville

unread,
May 3, 2025, 5:19:28 PMMay 3
to deap-...@googlegroups.com

Yes absolutely possible, you'll need to implement your own representation as a list of trees from there, make your own mutations and crossovers that can act on this representation by using the already existing operators. Not a walk in the park but possible 😅.


--
You received this message because you are subscribed to the Google Groups "deap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deap-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/deap-users/95c284b2-b40d-46ff-aa4e-f044aff72ccbn%40googlegroups.com.

RomanT

unread,
May 4, 2025, 3:38:09 AMMay 4
to deap-users
François-Michel, thank you for the prompt response!

Great to know there are no principle issue that make this task impossible or very hard to implement with DEAP :-)

"Not a walk in the park"... yeah. That's a fact.

Is there a chance you could write kind of a roadmap on how to implement it? Like "file A: implement A, B, C; file B - implement D, E, extend F". I'm not asking for implementation itself - that's up to me to deal with it - the plan with steps to make is what I need.

I understand the concept, but nuances are of great importance.

Thank you!

andrew morgan

unread,
May 4, 2025, 4:57:22 AMMay 4
to deap-...@googlegroups.com
As a suggestion - you might review “Geppy” on GitHub, it’s a python module that plugs in with deap nicely - for manipulating abstract syntax trees. If you set up the symbol table to have a mix of arities properly you can dynamically build trees of different sizes  that are well formed.


RomanT

unread,
May 4, 2025, 5:32:54 AMMay 4
to deap-users
Very interesting, thank you!

Will look into it.

RomanT

unread,
May 4, 2025, 9:08:15 AMMay 4
to deap-users
Examined Geppy, talked to the author.

Presently, Geppy does not support strong typing (and I need it 100%) and it is not trivial to incorporate typing into GEP concept. Geppy author has some plans to do that, but timing is unclear.

Looks like DEAP is still the main alternative.

On Sunday, 4 May 2025 at 11:57:22 UTC+3 andrew morgan wrote:
Reply all
Reply to author
Forward
0 new messages