We propose a graph-theoretic analytical framework to solve the sum rate maximization problem of a non-orthogonal-multiple-access (NOMA)-aided distributed millimeter wave massive multiple-input multiple-output (MIMO) system. The optimal solution for this system-wide sum rate maximization problem is neither mathematically tractable nor computationally-efficient when a traditional communication-theoretic analytical approach is solely invoked. Thus, the original problem is decoupled into two sub-problems, namely, a user access point (AP) association/clustering and a pilot resource allocation. In the first subproblem, APs optimally select a set of users having the highest average channel power gains, while the second sub-problem optimally assigns a set of limited orthogonal pilots among concurrently served users such that the pilot contamination is minimized. We propose a graph-theoretic analytical framework to find practically-viable and computationally-efficient solutions to both these sub-problems by virtue of modeling them via bipartite graph matching and vertex coloring problems. Thereby, we propose an algorithm to compute the minimum number of orthogonal pilots required for a given user-AP association/clustering. By exploiting the minimum pilot length and leveraging the benefits of our graph-theoretic approach, we propose a pragmatic solution of the coexistence of NOMA and orthogonal multiple-access schemes to further boost the achievable rate performance of our proposed system set-up.