A common approach in existing collaborative edge computing offloading schemes is to partition tasks into independent sub-tasks and offload them to participating servers. However, in practice, these sub-tasks often have dependencies, resulting in waiting time. To address this problem, we propose a collaborative computation offloading scheme based on Stackelberg game theory and graph theory (CCOSGG). First, we introduce a task clustering method based on graph theory, which uses task reconstruction and graph partition algorithm to cluster strongly related sub-tasks into appropriately sized clusters. Second, we use Stackelberg game theory to introduce an incentive mechanism that encourages remote edges to participate in the collaborative offloading. Finally, simulation results demonstrate that the proposed scheme can minimize latency and energy consumption at different network scales.