# US 2026/0099307 A1 · Automatic Code Topology Determination and Migration

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0099307 A1
- Document ID: US20260099307A1
- Status: Published application
- Kind: A1
- Application number: 18/909,744
- Filed: 2024-10-08
- Published: 2026-04-09
- Earliest claimed: 2024-10-08
- Assignees: Google Inc.
- Applicants: Google LLC
- Inventors: Yue Hu; Kamakshi Kodur; Leila Adnan Al-Muhtasib; Toby Lukas Jungen; Jose Jorge Jr Jimenez-Olivas; Shu-Wei Cheng
- Web page: https://patentgrep.com/patent/US20260099307A1

## CPC

- G06F 8/433: {Dependency analysis; Data or control flow analysis}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods, systems, devices, and non-transitory computer readable media for generating structural communities for code migration are provided. The disclosed technology can include receiving code data comprising code segments and generating a build dependency graph comprising nodes and edges. The nodes can correspond to the code segments and the edges can correspond to dependencies between the code segments. Over a plurality of iterations in which different combinations of the nodes are assigned to communities, based on maximizing a modularity score associated with a modularity of the communities, a structural community assignment comprising an assignment of the nodes to the communities that maximizes the modularity score can be determined. Code migration data based on the structural community assignment can be generated and can include migration tasks associated with migrating the code segments based on the structural community assignment. Furthermore, code migration data can be sent to a code review queue.

## Claims

### Claim 1

A computer-implemented method of generating structural community assignments for code migration, the computer-implemented method comprising:
receiving, by a computing system comprising one or more processors, code data comprising a plurality of code segments;
generating, by the computing system, based on the code data, a build dependency graph comprising a plurality of nodes and a plurality of edges, wherein the plurality of nodes correspond to the plurality of code segments, and wherein the plurality of edges correspond to a plurality of dependencies between the plurality of code segments;
determining, by the computing system, over a plurality of iterations in which different combinations of the plurality of nodes are assigned to a plurality of communities, based on maximizing a modularity score associated with a modularity of the plurality of communities, a structural community assignment comprising an assignment of the plurality of nodes to the plurality of communities that maximizes the modularity score, wherein the modularity score is based on a density of the plurality of edges within each of the plurality of communities relative to the density of the plurality of edges outside each of the plurality of communities;
generating, by the computing system, code migration data based on the structural community assignment, wherein the code migration data comprises a plurality of migration tasks associated with migrating the plurality of code segments based on the structural community assignment; and
sending, by the computing system, the code migration data to a code review queue.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein the determining, by the computing system, over a plurality of iterations in which different combinations of the plurality of nodes are assigned to a plurality of communities, based on maximizing a modularity score associated with a modularity of the plurality of communities, a structural community assignment comprising an assignment of the plurality of nodes to the plurality of communities that maximizes the modularity score comprises:
determining, by the computing system, in a first iteration of the plurality of iterations, that each node of the plurality of nodes is assigned to a different community of the plurality of communities; and
determining, by the computing system, over the plurality of iterations subsequent to the first iteration, mergers of different pairs of the plurality of communities that increase the modularity score by a greatest amount.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein the modularity score is positively correlated with a difference between an assignment of the plurality of nodes to the plurality of communities and a random assignment of the plurality of nodes to the plurality of communities.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein the modularity score is positively correlated with the density of the plurality of edges within the plurality of communities relative to the density of the plurality of edges outside the plurality of communities.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the modularity score is negatively correlated with a distance between the plurality of nodes in the plurality of communities, and wherein the distance between the plurality of nodes is based on a number of intervening nodes between a pair of nodes of the plurality of nodes.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein a first iteration of the plurality of iterations is based on a random assignment of the plurality of nodes to the plurality of communities.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein the plurality of nodes assigned to each of the plurality of communities is mutually exclusive with respect to the plurality of nodes assigned to other communities of the plurality of communities.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, wherein the determining the structural community assignment is performed by one or more machine-learned models trained to determine the structural community assignment based on input comprising the code data and the build dependency graph.

### Claim 9 (depends on 8)

The computer-implemented method of claim 8, wherein the one or more machine-learned models comprise one or more auto-encoder models.

### Claim 10 (depends on 8)

The computer-implemented method of claim 8, wherein the training of the one or more machine-learned models comprises:
receiving, by the computing system, training data comprising a plurality of training build dependency graphs comprising a plurality of training nodes connected by a plurality of training edges, wherein the plurality of training build dependency graphs are associated with a corresponding plurality of ground-truth structural community assignments, wherein the plurality of training nodes are associated with a plurality of training code segments, and wherein the plurality of training edges indicate dependencies between the plurality of training code segments;
determining, by the computing system, based on inputting the plurality of training build dependency graphs into the one or more machine-learned models, a plurality of predicted structural community assignments;
determining, by the computing system, a loss based on one or more differences between the plurality of predicted structural community assignments and the corresponding plurality of ground-truth structural community assignments; and
modifying, by the computing system, a plurality of parameters of the one or more machine-learned models to minimize the loss.

### Claim 11 (depends on 1)

The computer-implemented method of claim 1, wherein the plurality of code segments are associated with a plurality of directories, and wherein the plurality of code segments associated with a same directory of the plurality of directories correspond to the plurality of nodes assigned to a same community of the plurality of communities.

### Claim 12 (depends on 1)

The computer-implemented method of claim 1, wherein a number of the plurality of iterations is based on a predetermined threshold number of iterations.

### Claim 13 (depends on 1)

The computer-implemented method of claim 1, wherein the plurality of iterations continues until the modularity score exceeds a modularity score threshold.

### Claim 14 (depends on 1)

The computer-implemented method of claim 1, wherein the sending, by the computing system, code migration data to a code review queue comprises:
determining, by the computing system, a number of the plurality of migration tasks in the code review queue; and
determining, by the computing system, that the number of the plurality of migration tasks sent to the code review queue does not exceed a task utilization threshold associated with a capacity of the code review queue.

### Claim 15 (depends on 1)

The computer-implemented method of claim 1, wherein the sending, by the computing system, code migration data to a code review queue comprises:
determining, by the computing system, based on a distance between the plurality of nodes, a migration priority associated with an order in which the plurality of migration tasks are sent to the code review queue, wherein the migration priority of the plurality of migration tasks is positively correlated with the distance between a pair of the plurality of code segments associated with the plurality of migration tasks; and
sending, by the computing system, the plurality of migration tasks to the code review queue in an order based on the migration priority.

### Claim 16

One or more tangible non-transitory computer-readable media storing computer-readable instructions that when executed by one or more processors cause the one or more processors to perform operations, the operations comprising:
receiving code data comprising a plurality of code segments;
generating a build dependency graph comprising a plurality of nodes and a plurality of edges, wherein the plurality of nodes correspond to the plurality of code segments, and wherein the plurality of edges correspond to a plurality of dependencies between the plurality of code segments;
determining, over a plurality of iterations in which different combinations of the plurality of nodes are assigned to a plurality of communities, based on maximizing a modularity score associated with a modularity of the plurality of communities, a structural community assignment comprising an assignment of the plurality of nodes to the plurality of communities that maximizes the modularity score, wherein the modularity score is based on a density of the plurality of edges within each of the plurality of communities relative to the density of the plurality of edges outside each of the plurality of communities;
generating code migration data based on the structural community assignment, wherein the code migration data comprises a plurality of migration tasks associated with migrating the plurality of code segments based on the structural community assignment; and
sending the code migration data to a code review queue.

### Claim 17 (depends on 16)

The one or more tangible non-transitory computer-readable media of claim 16,
wherein the modularity score is positively correlated with a difference between an assignment of the plurality of nodes to the plurality of communities and a random assignment of the plurality of nodes to the plurality of communities.

### Claim 18

A computing system comprising:
one or more processors;
one or more non-transitory computer-readable media storing instructions that when executed by the one or more processors cause the one or more processors to perform operations comprising:
receiving code data comprising a plurality of code segments;
generating a build dependency graph comprising a plurality of nodes and a plurality of edges, wherein the plurality of nodes correspond to the plurality of code segments, and wherein the plurality of edges correspond to a plurality of dependencies between the plurality of code segments;
determining, over a plurality of iterations in which different combinations of the plurality of nodes are assigned to a plurality of communities, based on maximizing a modularity score associated with a modularity of the plurality of communities, a structural community assignment comprising an assignment of the plurality of nodes to the plurality of communities that maximizes the modularity score, wherein the modularity score is based on a density of the plurality of edges within each of the plurality of communities relative to the density of the plurality of edges outside each of the plurality of communities;
generating code migration data based on the structural community assignment, wherein the code migration data comprises a plurality of migration tasks associated with migrating the plurality of code segments based on the structural community assignment; and
sending the code migration data to a code review queue.

### Claim 19 (depends on 18)

The computing system of claim 18, wherein the modularity score is positively correlated with the density of the plurality of edges within the plurality of communities relative to the density of the plurality of edges outside the plurality of communities.

### Claim 20 (depends on 18)

The computing system of claim 18, wherein the modularity score is positively correlated with a difference between an assignment of the plurality of nodes to the plurality of communities and a random assignment of the plurality of nodes to the plurality of communities.
