ternery segment graphs