The work [41] partitions the network area into hexagons and shows that hexagon partitions achieve better network throughput than the square ones. The work [47] compared square, triangular, and hexagon partitions and proved that the hexagon partition gives the highest network throughput. Our proposed solution employs the physical interference-based model, but, in contrast to the most of the other physical-based model algorithms, we have tried to mitigate the combinatorial explosion instead of using line or space partitioning. We have performed the mitigation, firstly, using pairwise mutually acceptable line sets for each line. Then we construct the tree of mutually acceptable interfering line sets. New leaf nodes are chosen from the ever decreasing set intersection of the pairwise mutually acceptable line sets of the lines in the path from the parent node to the root. Then we apply a minimal set cover algorithm to find the minimal number of concurrently transmitting line sets. Tree construction has exponential worst-case time and space complexity if all lines in the network can transmit together. By randomly pruning the tree and using the genetic algorithm to find the pruned tree which gives the same minimal set cover as the full tree, we have reduced the worst space and time complexities to the polynomial ones. We have devised our solution with parallelism in mind to speed up the resource allocation even more. Our solution offers the following key features:  
* Each main step of the proposed solution is parallelizable. It enables large-scale distributed computation for large ad hoc networks. * Searching for acceptable interfering line sets leads to a combinatorial explosion. To overcome this problem, the proposed solution creates acceptable line sets. These line sets are created using tree construction with pairwise limitations and pruning. * The proposed solution employs a centralized approach to optimize network capacity without clusterization or partitioning in contrast to most approaches for large ad hoc networks [48; 49; 50]. * The proposed solution guarantees fairness; some channel resource will be given to each active line. * The solution guarantees a bit error rate lower than the requested threshold for each line. * The optimization is conducted in a natural complex search space, rather than in the simplified convex alternative. * Parallel transmission with one orthogonal resource includes the case of NOMA. The proposed algorithm can be used to optimize NOMA groups in 6G cellular networks and ad hoc networks. Application of our solution to NOMA can be realized as follows: All outgoing lines of every node can be grouped and replaced with one or multiple lines to the most distant recipient node inside the group. Those lines will be NOMA encoded, containing the signals for all lines in the group. As a result, we replace multiple outgoing lines with fewer NOMA lines. Grouping lines into NOMA lines into various combinations and using our proposed solution, we can find the set of NOMA lines which requires the minimal number of orthogonal channel resources. * The proposed solution makes real-time decentralized resource allocation possible using machine learning and artificial intelligence. Let us elaborate on the machine learning application. Generating a large number of random topologies, we combine lines into groups that can use the same channel resource, obtaining the training set. The number of lines cannot be larger than the squared number of nodes, and the number of groups cannot be larger than the number of lines. For example, we can train the following neural network with the following inputs and outputs. Inputs: all node coordinates; vector of transmission powers; each node's receiver noise plus interference. Outputs: multiple binary vectors, each of them representing the group of lines with the same orthogonal resource. The inference of the neural network trained with the results of our solution can be much faster than using our solution directly.