Is it true that if in $$AX=0$$ where $A$ is $n\times n$ matrix over field $\Bbb K$ and $X$ is a length $n$ vector of variables if $rank(A)=n-1$ we will have an unique solution up to constant factors?
How do you solve for such a solution (assume $XX'=r\in\Bbb N$)?
You're basically asking for the null space of $A$.
A standard way to find a basis for the null space is to take the singular value decomposition:
$$ U \Sigma V^* = A $$
where $\Sigma$ is a diagonal matrix containing what is known as the singular values.
Note: this is how many numerical linear algebra systems (eg. Matlab, numpy) calculate rank and null space.