The perimeter is the sum of the lengths of the sides. The given information means ...
... (x-2) + x + (3x+1) = (2x-5) + (x+4) + (6x-7)
... 5x -1 = 9x -8 . . . . . simplify
... 0 = 4x -7 . . . . . . . . subtract the left side
... 0 = x -7/4 . . . . . . . .divide by the coefficient of x
... x = 7/4