Lie groups of point symmetries of partial differential equations constitute a fundamental tool for constructing group–invariant solutions. The number of subgroups is potentially infinite and so the number of group–invariant solutions. An important goal is a classification in order to have an optimal system of inequivalent group–invariant solutions from which all other solutions can be derived by action of the group itself. In turn, a classification of inequivalent subgroups induces a classification of inequivalent Lie subalgebras, and vice versa. A general method for classifying the Lie subalgebras of a finite–dimensional Lie algebra relies on the use of inner automorphisms. We present a novel effective algorithm that can automatically determine optimal systems of Lie subalgebras of a generic finite–dimensional Lie algebra; here, we limit the analysis to one–dimensional Lie subalgebras, though the same approach still works well for higher dimensional Lie subalgebras. The algorithm is implemented in the computer algebra system Wolfram Mathematica™ and illustrated by means of some examples.