The graphener program modified for the ternary case.