How to Build Equity Penetration Analysis: Graph Modeling, Algorithms, and Engineering Practices
Equity penetration—tracing a target company's real ownership and control through a multi-layer network of shareholders—is central to credit review, supply-chain onboarding, anti-money-laundering, and related-party detection. This article explains how to build an engineering-grade equity penetration system: how to define penetration rules (beneficial-ownership vs. control penetration), how to source and govern the underlying data, how to model equity relationships as a property graph, and three algorithms for computing penetration ratios (path traversal, linear equations for cyclic ownership, and recursive SQL queries). It also covers where large language models fit, how to handle performance, explainability, and compliance, and closes with a practical implementation checklist.
1. Why Equity Penetration Needs Engineering
In scenarios such as credit review, supply-chain onboarding, anti-money-laundering (AML), and related-party identification, the target company that risk teams examine is often just one node in a much larger equity network. Above it sit shareholders, and above them more shareholders, stacked as many as a dozen layers deep; below it sit subsidiaries and minority-stake companies, with the node count easily growing into the hundreds of thousands or even millions. Looking only at first-layer “surface shareholding” can easily lead to the wrong conclusion:
- The actual controller is hidden through dilution. A natural person (say, Person A) indirectly controls the target company through several holding platforms. If you look only at direct shareholders, Person A appears insignificant; only after full penetration does Person A emerge as the one who really calls the shots.
- Related-party relationships are missed. Two suppliers that appear unrelated may, after tracing up several layers, belong to the same actual controller. They should be managed as related-party transactions, yet they are granted credit separately as independent third parties.
- Economic interests are underestimated. A group spreads its holdings across multiple entities, so no single segment looks large on its own. Only by summing all paths can you obtain the true interest ratio.
Manually reviewing the equity structure layer by layer is feasible, but when the group hierarchy is deep and equity changes frequently, three problems are hard to avoid: high cost, prone to error, and inconsistent conclusions across different analysts. The value of engineering, therefore, lies not only in “querying the graph” but in four points:
- The same set of rules is applied consistently to every customer;
- Every conclusion can be traced back to a specific data source and calculation path;
- When equity changes, results can be recomputed incrementally instead of re-run in full;
- The system remains responsive at a scale of hundreds of thousands of nodes.
The discussion below starts with rule definition, then covers data, modeling, algorithms, engineering implementation, and compliance.
2. Define the Rules First: Beneficial-Ownership Penetration vs. Control Penetration
Many disputes over penetration results come not from algorithm errors but from rules that were never agreed on in advance. Before development, at least the following four agreements should be clarified at the requirements level and fixed as configurable rule parameters.
2.1 Different penetration goals require different algorithms
| Penetration goal | Basis for calculation | Typical use |
|---|---|---|
| Beneficial-ownership penetration | Multiply and sum along shareholding ratios | Computing actual beneficial interest, identifying hidden shareholders |
| Control penetration | Voting-right ratios, relative control, concerted-action relationships | Determining the actual controller, deciding consolidation scope |
| Related-party identification | Whether there is a common actual controller | Related-party transaction review, unified credit for group customers |
The two must not be conflated. In a company with a dual-class share structure, minority shareholders may hold a majority of voting rights with a relatively low shareholding ratio. Voting-right proxies and concerted-action agreements can also make voting-right ratios deviate substantially from shareholding ratios. Therefore, it is best for the shareholding edge in the graph model to record both an “equity ratio” and a “voting-right ratio”; control penetration can reuse the same traversal logic, simply replacing the multiplication factor with the voting-right ratio.
2.2 Recursive definition of beneficial-ownership penetration
Let $si$ be the final beneficial-interest ratio of node $i$, $d_i$ its direct shareholding ratio, and $a{ji}$ the direct ratio with which node $j$ holds node $i$. Then:
$si = d_i + \sum{j} a_{ji} \cdot s_j$
Intuitively:
- Multiply: Along a path $A \to B \to C$, the shareholding ratios are 100% and 60% in sequence, so A’s contribution to C is $100\% \times 60\% = 60\%$.
- Sum: If A also directly holds 20% of C in addition to holding C indirectly through B, then A’s final beneficial interest in C is $60\% + 20\% = 80\%$.
In real equity data, “summing multiple paths” and “multiplying through multiple layers” often occur together—which is exactly why this needs to be computed programmatically rather than judged by hand.
2.3 Reference thresholds should be parameterized
In identifying beneficial owners and actual controllers, the industry widely uses 25% as an important reference threshold. Natural persons or other entities that reach this ratio are typically brought into scope for closer scrutiny. But the threshold is only part of the rule; the following cases must also be handled:
- Entities that fall below the threshold yet exercise control through agreements, personnel arrangements, or other means;
- Entities whose single-path ratio is low across multiple layers but which cross the threshold once summed.
These thresholds should all be managed as configuration items, not hard-coded into the algorithm. After all, decision criteria differ across business lines and regulatory requirements.
3. Data Sources and Data Governance
3.1 Where does the data come from
The inputs for equity penetration typically come from the following types of data:
- Shareholder and capital-contribution information in company registration records;
- Controlling shareholder and actual controller information disclosed in listed companies’ periodic reports;
- Equity structure sections in bond prospectuses and rating reports;
- Public information such as judicial records and tender/bidding data, used to supplement the identification of hidden related-party relationships.
From an engineering standpoint, these can be divided into three data-source types:
- Structured data: Well-defined fields, lowest integration cost, suitable as backbone data.
- Semi-structured data: Equity structure tables in announcements and reports, which must be parsed before ingestion.
- Unstructured data: Narrative passages in prospectuses and news, which require text-extraction capabilities.
3.2 Six common data-quality problems
- Inconsistent entity names: Abbreviations, former names, full-width vs. half-width parentheses, and mixed traditional/simplified characters can cause one entity to be treated as multiple.
- Missing or erroneous entity identifiers: Some historical data lacks the Unified Social Credit Code, and data-entry errors in codes also occur, so codes cannot directly serve as a unique key.
- Chaotic representation of shareholding ratios: “40%”, “40.00%”, “0.4”, and “subscribed CNY 40 million” mixed in the same column must be standardized before they can be used in calculations.
- Confusion between subscribed and paid-in capital: Subscribed capital does not equal actual beneficial interest, so the caliber used must be explicit when computing beneficial interest.
- Timeliness issues: A time lag exists between business registration, periodic reports, and real-time equity status; data may lag shortly after an equity change.
- Caliber gaps: Information such as concerted-action relationships, voting-right proxies, and contractual control is often absent from standard registration data and must be supplemented separately.
3.3 Governance strategy
To address the above problems, I recommend implementing the following strategies at the design stage:
- Use the Unified Social Credit Code as the primary key, with names only as an auxiliary matching field;
- Build an alias table recording the correspondence between abbreviations, former names, and standard names;
- Retain source, collection time, and version number for every edge, to support point-in-time lookback;
- Run standardized validation before ingestion: shareholding ratios fall within a reasonable range, denominators are non-zero, and edges do not point to non-existent entities.
4. Graph Modeling: Turning Equity Relationships into a Graph
4.1 The property graph model
Equity structures are naturally graphs, so the property graph model describes them most naturally: vertices represent entities, edges represent shareholding or control relationships, and both vertices and edges can carry attributes.
# Vertex: entity (company, natural person, other organization)NODE = {"id": "9144...X", "name": "Example Technology Co., Ltd.", "type": "COMPANY"}# Edge: shareholding relationship (multiple edges between the same pair of entities are allowed)EDGE = {"src": "9144...Y", # Shareholder"dst": "9144...X", # Investee"equity": 0.50, # Equity ratio"voting": 0.50, # Voting-right ratio"source": "Business registration","updated_at": "2025-03-01",}
A few easily overlooked modeling details:
- There may be multiple edges between the same pair of entities. For example, if two entities invest using their own funds and through a partnership respectively, these should be kept as two edges and naturally summed during calculation, rather than “deduplicated and overwritten.”
- Entities must be typed. Natural-person nodes involve personal information protection and should be handled differently from company nodes.
- Retain time attributes on edges. Point-in-time queries (e.g., “what did the equity structure look like two years ago”) depend on edge effective times.
4.2 Hybrid storage: graph database + object storage
When nodes and edges reach the millions or even tens of millions, consider a “graph database + object storage” combination: the graph database stores relationships and handles penetration queries, while object storage holds the original announcement files, intermediate parsing results, and historical snapshots. The benefit is that the graph structure stays lightweight, complex multi-hop queries are backed by a dedicated engine, and the raw data remains traceable.
4.3 Entity resolution: the first gate to penetration accuracy
No matter how sound the graph model is, if one entity is split into multiple nodes, the penetration result becomes distorted. Entity resolution addresses the problem of “merging records that point to the same entity”:
- Strong-identifier matching: Prefer the Unified Social Credit Code; an exact match can be merged directly.
- Name normalization: Unify full-width/half-width and traditional/simplified forms, strip organizational-form suffixes (such as “Co., Ltd.” or “Joint Stock Company”), then compare, and handle former names using the alias table.
- Similarity computation: For entities lacking a code, combine edit distance, pinyin similarity, vector recall, and other methods to find candidates, then use fields such as registered address and legal representative for secondary confirmation.
- Confidence grading: Auto-merge high-confidence matches; send medium/low-confidence ones to a manual-review queue, with review results feeding back into the alias library.
5. Core Algorithms: Three Ways to Compute Penetration Ratios
5.1 Method 1: Path traversal (suitable for acyclic scenarios)
The most direct approach is to perform a depth-first traversal from the start node, multiply along each path, and sum across all paths. The illustrative code below handles multi-path summation, cycle truncation, and computation-volume protection.
from collections import defaultdictdef penetrate(graph, root, max_depth=10, max_paths=200000):"""graph: {shareholder: [(investee, ratio), ...]}; returns the root's beneficial-interest ratio for each entity"""result = defaultdict(float)stack = [(root, 1.0, 0, (root,))] # (current node, path product, depth, nodes on the path)visited = 0while stack:node, ratio, depth, path = stack.pop()if depth >= max_depth:continuefor nxt, weight in graph.get(node, ()):if nxt in path: # Nodes on a cycle: truncate, do not double countcontinueshare = ratio * weightresult[nxt] += share # Accumulate multiple paths directlyvisited += 1if visited > max_paths:raise RuntimeError("Path count exceeded the protection limit; check for abnormally dense structures in the data")stack.append((nxt, share, depth + 1, path + (nxt,)))return dict(result)# Example: Group W -> Holding Platform Y 100%, Holding Platform Y -> Company X 50%, Group W directly holds 20% of Company Xgraph = {"Group W": [("Holding Platform Y", 1.00), ("Company X", 0.20)],"Holding Platform Y": [("Company X", 0.50)],}print(penetrate(graph, "Group W"))# Output: {'Holding Platform Y': 1.0, 'Company X': 0.7}# Company X = 100% x 50% (indirect path) + 20% (direct path) = 70%
This method is simple to implement, and results can be explained item by item as “who contributed how much through which path.” However, when circular shareholding exists, simple truncation discards the repeated contributions on the cycle and yields an approximation. That is when the second method is needed.
5.2 Method 2: Linear equations (suitable for cyclic scenarios)
Circular shareholding is not uncommon in practice. For example, a subsidiary buying back the parent’s shares, or an employee stock-ownership platform holding shares crosswise, can all form cycles. Here the recursive formula can be arranged in matrix form:
$S = D + A^T S \;\Longrightarrow\; (I - A^T)\,S = D$
- $A$: the direct shareholding matrix, where $A_{ji}$ is the ratio with which node $j$ holds node $i$;
- $D$: the direct shareholding vector;
- $S$: the final beneficial-interest vector.
As long as the total product of the cycle is less than 1 (usually satisfied in practice), this system of equations has a unique solution. You can first perform an LU decomposition, then obtain the results for all start nodes at once via back-substitution, avoiding the repeated computation of node-by-node traversal.
def penetrate_with_cycles(nodes, direct, max_iter=100, tol=1e-9):"""direct: {(shareholder, investee): ratio}; returns each start node's beneficial-interest ratio for every nodeIdea: S = D + A^T*S, solved via fixed-point iteration, with the results clamped"""result = {}for root in nodes:s = {n: 1.0 if n == root else 0.0 for n in nodes} # D: direct shareholding vectorfor _ in range(max_iter):nxt = dict(s)for (h, t), w in direct.items():nxt[t] += s[h] * w # Propagate along the shareholding directionnxt = {n: min(v, 1.0) for n, v in nxt.items()} # A single entity's own interest does not exceed 100%delta = max(abs(nxt[n] - s[n]) for n in nodes)s = nxtif delta < tol:breakresult[root] = sreturn result# Example: A -> B 100%, B -> C 80%, C -> B 40% (B and C form a cycle)edges = {("A", "B"): 1.0, ("B", "C"): 0.8, ("C", "B"): 0.4}nodes = ["A", "B", "C"]print(penetrate_with_cycles(nodes, edges))# Output (approx.): {'A': {'A': 1.0, 'B': 1.0, 'C': 1.0},# 'B': {'A': 0.0, 'B': 1.0, 'C': 1.0},# 'C': {'A': 0.0, 'B': 0.4, 'C': 1.0}}
Two points need special clarification:
- For demonstration convenience, this implementation clamps using the simplified strategy “a single node does not exceed 100%”; in production, the clamping scheme should be designed according to business rules, for example by scaling by the direct shareholding ratio, or truncating at the cycle and then iterating.
- Without clamping, A’s beneficial-interest ratio in C converges to $80\% / (1 - 80\% \times 40%) \approx 117.65\%$—the classic characteristic of circular shareholding: the same block of interest is repeatedly counted. Clamping rules are essentially a business caliber and must be confirmed by the business side, not decided by the algorithm itself.
5.3 Method 3: Recursive query (suitable for relational-database scenarios)
If the base data is already in a relational database, a recursive query can perform a finite-depth penetration directly:
WITH RECURSIVE trace(start_name, cur_name, share, depth) AS (-- Anchor: the start node itselfSELECT name, name, CAST(1 AS DECIMAL(10, 6)), 0 FROM company WHERE name = 'Group W'UNION ALL-- Recursion: expand downward along shareholding edgesSELECT t.start_name, e.dst,t.share * e.equity,t.depth + 1FROM trace tJOIN holding e ON e.src = t.cur_nameWHERE t.depth < 10)SELECT cur_name AS node, SUM(share) AS equityFROM traceWHERE depth > 0GROUP BY cur_name;
This approach does not depend on additional compute components and suits scenarios with a limited node count and shallow penetration depth. Note, however, that different databases implement recursive queries differently and have different default depth limits; once a cycle exists in the data, it must be combined with depth limits and access-path deduplication.
5.4 How to choose among the three methods
| Dimension | Path traversal | Linear equations | Recursive query |
|---|---|---|---|
| Supports cycles | Approximation by truncation only | Yes | Needs extra handling |
| Implementation complexity | Low | Medium | Low |
| Result explainability | Strong (can output paths) | Weak (numbers only) | Medium |
| Suitable scale | Small/medium scale, controllable depth | Better for large sparse matrices | First choice when data is already in a relational DB |
A common combination in practice is: use path traversal by default, because it outputs complete paths and is easy to explain; switch to the matrix method when a cycle is detected; and when data is already in a relational database, use a recursive query directly as a fast lane.
6. Where Large Language Models Fit: Capability Assessment
6.1 What to use LLMs for
The value of LLMs does not lie in replacing graph algorithms, but in converting “unstructured documents” into “structured equity records”:
- Extracting shareholder lists and shareholding ratios from announcements, annual reports, and prospectuses;
- Aligning the extracted results to standard entities in the graph;
- Identifying implicit relationships such as “indirectly holds through…” and “is a concerted actor with…” in narrative text.
The penetration calculation itself is still done by deterministic algorithms, to ensure results are reproducible and auditable.
6.2 How to objectively evaluate whether a model is “good enough”
Model iteration moves fast; rather than chasing the “latest version,” it is better to build your own evaluation method:
- Build an evaluation set: Take stratified samples from real documents, covering multi-shareholder tables, long documents, scanned copies, vague expressions, and other scenarios, and have business experts annotate the ground truth.
- Define metrics:
- Field precision and recall;
- Mean absolute error of shareholding ratios;
- Proportion of fabricated content (hallucination rate);
- Legality rate of structured outputs (e.g., data in an agreed format);
- Accuracy of locating key information under long-document input.
- Look at engineering properties: Throughput and latency, inference cost per document, whether the context length is enough to hold a complete section, and whether the deployment form meets data-residency requirements.
- Set baselines for comparison: Compare against rule-based extraction and manual extraction, to avoid “the new model feels better”-style conclusions. Repeat each metric over multiple rounds and take statistics, rather than relying on a single experience.
6.3 Continuous evaluation after launch
A model going live does not mean evaluation is over:
- Regularly run regression tests with newly added samples, to prevent model updates from causing extraction-quality fluctuations;
- Force manual review of low-confidence results and accumulate them as new evaluation samples;
- Tag extraction results with the model version, to facilitate issue tracing and effect comparison.
7. Performance and Engineering: From “Runs” to “Usable”
7.1 Tiered storage
- Hot data (frequently queried entities and relationships): stored in the graph database or an in-memory compute engine;
- Warm data (historical snapshots, change records): stored on the big-data platform for batch computation;
- Cold data (original announcements, scanned copies): archived in object storage and read on demand.
7.2 Incremental computation and precomputation
Changes to equity data are measured in “change events.” When an edge changes, only the affected target nodes need to be recomputed, with delta updates applied to the penetration relationships, rather than a full re-run. For frequently queried entities, penetration results can be precomputed and cached, with invalidation triggered by change events.
7.3 Computation protection
- Set a maximum traversal depth and maximum path count;
- Split subgraphs for extremely large groups, compute in parallel, then merge;
- Monitor the latency of long-tail queries, and alert promptly on abnormal structures (such as densely connected cycles or nodes with too many edges).
7.4 Observability
Record the input data version, rule version, elapsed time, and result summary of each penetration computation, to ensure issues are traceable. General cloud services such as graph database clusters, big-data platforms, and message queues are already fairly mature; if you want to reduce the effort spent on underlying operations, you can also assemble the corresponding product capabilities on cloud platforms such as Baidu AI Cloud on demand, focusing your energy on the graph model and algorithms themselves.
8. Result Presentation and Explainability
Penetration results must be “understandable and trustworthy” to people:
- Layered visualization: Display the equity structure by layer, with node size mapped to the beneficial-interest ratio, edge labels showing shareholding ratios, and key paths highlighted.
- Path details: Besides the final ratio, list each path from “start → intermediate layer → target” and its contribution, making it easy for business staff to verify.
- Dual-view switching: The same entity can be switched between the “beneficial-ownership view” and the “control view,” making the differences between the two visible at a glance.
- Point-in-time lookback: Specify any historical point in time to view the equity structure and penetration result at that time.
9. Data Compliance and Security
Equity data contains both company information and the personal information of natural-person shareholders, so compliance requirements must be considered from the very start of the design:
- Data minimization: Collect only the shareholder information necessary for the business, and mask sensitive fields such as natural-person ID numbers by default.
- Tiered authorization: Control the data scope and penetration depth that each role can query, with all queries and exports logged for audit.
- Lawful sourcing: Ensure that data acquisition channels are lawful and compliant, and respect the usage terms of the data sources.
- Traceable conclusions: Attach the data time, rule version, and calculation process to penetration conclusions delivered externally, to facilitate review and responsibility assignment.
10. Implementation Checklist
| Stage | Key actions | Acceptance criteria |
|---|---|---|
| Rule definition | Clarify beneficial-ownership/control calibers, thresholds, and cycle-handling rules | Rule document passes review and is configurable |
| Data ingestion | Multi-source collection, standardized validation, version management | Completeness and accuracy of key fields meet targets |
| Graph modeling | Entity resolution, alias library, point-in-time attributes | Duplicate rate of the same entity is below the set target |
| Algorithm implementation | Path traversal / matrix solving / recursive query | Results match manual sampling checks |
| Engineering optimization | Tiered storage, incremental computation, caching | High-frequency query response time meets business requirements |
| Presentation and compliance | Visualization, permissions, masking, audit | Passes security review |
11. Conclusion
Equity penetration may look like simply “following the shareholders upward,” but once truly engineered, it becomes a systems effort involving data governance, graph modeling, algorithm design, engineering optimization, and compliance management. Rules-first avoids most disputes; entity resolution sets the ceiling on result quality; cycle handling and clamping rules reflect business understanding; and explainability determines whether the system can truly be accepted by the business. As for model and tool selection, rather than chasing hype, it is better to build your own evaluation system and let the data speak. Get these things solid, and equity penetration can evolve from a one-off “manual graph search” into a reusable, auditable, and continuously evolving foundational capability.
