### Partially commutative monoid of a graph

I am interested in the free partially commutative monoid associated to a graph whose definition can be seen here www.sciencedirect.com/science/article/pii/0304397591903556 and here https://en.m.wikipedia.org/wiki/Trace_monoid.

Basically I need a free monoid in which some variables commutes.

My questions are

whether this notion is already implemented in Sage?

If not how to implement this in ~~Sage? ~~Sage?