Theory/equation for wiring a irregularly shaped LED matrix for row/column selection
If you don't have to pack your LEDs so close together that the layout is overly constrained, simply make the schematic a rectangular 12 x 8 matrix.

Then place the LEDs physically where you want them such that they can still be interconnected with traces. 







simulate this circuit &ndash; Schematic created using CircuitLab

The above two diagrams are electrically identical (a 3 x 3 matrix) but in the right hand one the LEDs are physically arranged in a crude heart shape to illustrate what the PCB layout could look like. 

If your problem is how to drive a 12 x 8 matrix, that can easily be done with 20 pins, but it's not much harder to use fewer pins.. for example 3 x 74HC595 will allow the use of 10 or 11 pins with no sweat.