In the tropical limit of matrix KP-II solitons, their support at fixed time is a planar graph with "polarizations" attached to its linear parts. In this work we explore a subclass of soliton solutions whose tropical limit graph has the form of a rooted and generically binary tree, as well as solutions with a limit graph consisting of two relatively inverted such rooted tree graphs. The distribution of polarizations over the constituting lines of the graph is fully determined by a parameter-dependent binary operation and a (in general nonlinear) Yang-Baxter map, which in the vector KP case becomes linear, hence is given by an R-matrix. The parameter-dependence of the binary operation leads to a solution of the pentagon equation, which exhibits a certain relation with the Rogers dilogarithm via a solution of the hexagon equation, the next member in the family of polygon equations. A generalization of the R-matrix, obtained in the vector KP case, is found to also solve a pentagon equation. A corresponding local version of the latter then leads to a new solution of the hexagon equation.