The notion of $12$-representable graphs was introduced as a variant of a well-known class of word-representable graphs. Recently, these graphs were shown to be equivalent to the complements of simple-triangle graphs. This indicates that a $12$-representant of a graph (i.e., a word representing the graph) can be obtained in polynomial time if it exists. However, the $12$-representant is not necessarily optimal (i.e., shortest possible). This paper proposes an $O(n^2)$-time algorithm to generate a shortest $12$-representant of a labeled graph, where $n$ is the number of vertices of the graph.