Equity Penetration Implementation: Graph Modeling Algorithms and Audit Essentials

    This article explains how to implement equity penetration (tracing direct and indirect ownership through a corporate ownership graph) as a reliable, auditable engineering system. It covers the core calculation principles for multi-path ownership and voting-rights penetration, how to build a clean time-aware property graph model, how to deduplicate effective edges, and how to implement the traversal with breadth-first search and recursive SQL CTEs. It also addresses cycles, cross-shareholding, limited partnerships and funds, differential voting rights, data quality and entity resolution, technology selection between relational and graph databases, and the pre-launch validation checklist needed to produce reproducible and traceable results.

    1. What Equity Penetration Is and Why It Is Hard

    Equity penetration generally means calculating, layer by layer along an ownership chain, a party’s direct or indirect interest in a target company, and identifying the parties that hold actual control or significant influence. It is commonly used for unified credit granting across group customers, related-party transaction detection, beneficial ownership checks, pre-investment due diligence, and IPO compliance review.

    Common questions include: what equity penetration is, how the penetration ratio is calculated, how to choose a graph database for it, and what mistakes are commonly made. These questions look different but all point to the same technical difficulty: a real ownership network is usually not a simple tree. It is a directed graph that contains multiple paths, cycles, cross-shareholding, nested funds, nominee holdings, voting-rights proxies, and multiple rounds of changes.

    For this reason, equity penetration is not simply “querying a few hops.” It must solve four kinds of problems at once:

    1. How to correctly accumulate contributions from multiple paths;
    2. How to safely handle cycles, cross-shareholding, and deep branches;
    3. How to trace back historical points in time and version changes;
    4. How to reproduce, trace, and audit each computation result.

    This article presents a practical implementation approach, together with corrected algorithms and SQL examples.

    2. Core Concepts and Calculation Principles

    2.1 Basic Terminology

    Term Meaning
    Direct holding The ownership ratio directly registered by a party
    Indirect holding Interest held layer by layer through intermediate entities, multiplied along the path at each layer
    Penetrated holding ratio The total ratio obtained by summing direct holdings and all valid indirect holdings
    Voting-rights penetration Control relationships calculated by the voting ratio at each layer
    Control penetration Control judged by combining agreement arrangements, board seats, concerted-action relationships, and more
    Beneficial owner The natural person or entity that ultimately enjoys the interest or exercises ultimate control

    2.2 Symbols and Formulas

    Let a party be U and the target company be X. A path from U to X is:

    1. U --r1--> A1 --r2--> A2 -- ... --r(n+1)--> X

    where:

    • r_i: the ownership or voting ratio at layer i, usually between 0 and 1;
    • P: a simple path, meaning no node is visited more than once within the path;
    • C(P): the contribution of path P to U’s interest;
    • R(U, X): U’s penetrated ratio in X.

    The path contribution is:

    1. C(P) = r1 × r2 × ... × r(n+1) = ∏ r_i

    The multi-path penetrated ratio is:

    1. R(U, X) = Σ C(P), P ∈ SimplePaths(U, X)

    Key point: different paths must be calculated separately and then summed. You cannot merge multiple paths and then multiply them together.

    Example: A directly holds 10% of X, and also holds it indirectly through B and C. B holds 40% of X, and A holds 60% of B; C holds 25% of X, and A holds 50% of C. Then:

    1. A's penetrated ratio in X = 10% + 60% × 40% + 50% × 25% = 34.5%

    The voting-rights penetration formula is the same, but each layer should use the voting ratio v_i rather than the ownership ratio. Under scenarios such as dual-class shares, voting-rights proxies, and concerted-action agreements, the two can lead to different conclusions.

    3. Data Modeling: First Clean Up Entities, Time, and Edges

    3.1 Property Graph Model

    A “node + edge” property graph model is recommended:

    • Nodes: natural persons, enterprises, limited partnerships, funds, asset management products, and so on;
    • Primary key: the unified social credit code or an internal entity ID;
    • Edges: directed holding relationships, pointing from the upper-level party to the invested entity;
    • Edge properties: ownership ratio, voting ratio, effective date, expiry date, data source, collection time, confidence;
    • Auxiliary edges: appointments, guarantees, address overlap, suspected common control, and so on, used to identify hidden relationships.

    Edges must carry time attributes. When querying the penetrated result “as of a given date,” only edges satisfying the following conditions should be used:

    1. valid_from <= as_of AND (valid_to IS NULL OR as_of < valid_to)

    3.2 Deduplicating Effective Edges

    Before traversing the graph, edges must be deduplicated by query time point. Otherwise, multiple sources, duplicate contributions, and version changes will cause double counting.

    Common rules are as follows:

    1. Keep only one valid edge per (src, dst, as_of);
    2. When multiple sources conflict, select the primary record by “source credibility × timeliness,” and keep candidate records and confidence;
    3. If multiple genuine contributions exist between the same pair of parties, do not simply add or overwrite them; distinguish them with an interest sub-identifier, for example (src, dst, benefit_id);
    4. A relationship with a missing ratio must not be defaulted to 0 or 1; it should first be completed or sent to a manual verification queue.

    A simplified Python normalization example:

    1. from dataclasses import dataclass
    2. @dataclass(frozen=True)
    3. class Edge:
    4. src: str
    5. dst: str
    6. ratio: float
    7. valid_from: str
    8. valid_to: str | None = None
    9. confidence: float = 0.0
    10. source: str = ""
    11. def normalize_effective_edges(edges, as_of):
    12. chosen = {}
    13. for e in edges:
    14. if e.valid_from <= as_of and (e.valid_to is None or as_of < e.valid_to):
    15. key = (e.src, e.dst)
    16. old = chosen.get(key)
    17. if old is None or (e.confidence, e.source) > (old.confidence, old.source):
    18. chosen[key] = e
    19. return list(chosen.values())

    If genuine multiple interests exist, this can be changed to:

    1. key = (e.src, e.dst, e.benefit_id)

    But the raw data must be able to reliably identify benefit_id; otherwise, rather than adding directly, it is better to output a conflict warning.

    4. Penetration Algorithm Implementation

    4.1 Adjacency-List Breadth-First Traversal

    The core idea is: perform a breadth-first traversal that carries the cumulative ratio, avoid duplicate nodes within the set of paths, and record any cycles encountered.

    1. from collections import defaultdict, deque
    2. def penetrate(root, edges, as_of="2024-12-31", min_ratio=1e-4, max_depth=20):
    3. normalized = normalize_effective_edges(edges, as_of)
    4. adj = defaultdict(list)
    5. for e in normalized:
    6. adj[e.src].append(e)
    7. result = defaultdict(float)
    8. cycles = []
    9. queue = deque([(root, 1.0, (root,), 0)])
    10. while queue:
    11. node, ratio, path, depth = queue.popleft()
    12. for e in adj.get(node, ()):
    13. if e.dst in path:
    14. cycles.append(path + (e.dst,))
    15. continue
    16. new_ratio = ratio * e.ratio
    17. if new_ratio < min_ratio:
    18. continue
    19. result[e.dst] += new_ratio
    20. if depth + 1 < max_depth:
    21. queue.append((e.dst, new_ratio, path + (e.dst,), depth + 1))
    22. return result, cycles

    Note: even if a given path has already reached the target entity, you must not stop the whole traversal just because that path met a threshold, because the cumulative holding ratio requires summing all paths.

    Early termination is only allowed in the following cases:

    1. The business only needs a list of single paths that meet a threshold, not a cumulative ratio;
    2. It has been proven that the contributions of all remaining paths are 0;
    3. Safe upper-bound pruning is used, and the bound is explainable and reproducible.

    For example, if the current cumulative ratio is r and the maximum possible interest upper bound from the current node to the target node is upper_bound, then when:

    1. r × upper_bound < threshold

    it is safe to prune. The upper bound can be conservatively estimated from the precomputed maximum single-hop ratio, the sum of out-edge ratios, the maximum depth, and so on, but the exact definition must be made explicit.

    4.2 Pruning Does Not Guarantee Linear Complexity

    Pruning is key to improving performance, but you cannot simply claim that “each edge is expanded only once.” The worst-case complexity of simple-path enumeration can still be exponential.

    The actual complexity is affected by the following factors:

    • Maximum depth;
    • The cumulative-ratio pruning threshold;
    • Whether the graph contains many cycles, branches, or cross-shareholdings;
    • Whether valid edges have been deduplicated;
    • Whether any out-edge ratios are abnormally greater than 1 in the data;
    • Whether all paths need to be output or only the aggregated result.

    Therefore, in engineering terms it should be stated as follows: pruning can reduce the number of invalid paths, but whether it is fast enough must be assessed through benchmarking, data scale, and query patterns. No unconditional linear-complexity guarantee can be given.

    4.3 Relational Database Implementation: Corrected Recursive CTE

    The following uses PostgreSQL-style syntax. The core steps are:

    1. First deduplicate valid edges by (src, dst);
    2. The anchor path includes the start node and the first-hop endpoint;
    3. The recursive step appends the new endpoint to the path array;
    4. Before recursing, check whether the new endpoint is already in the path, to avoid self-loops or repeated nodes;
    5. Finally aggregate by endpoint.
    1. WITH RECURSIVE valid_edge AS (
    2. SELECT DISTINCT ON (src, dst)
    3. src,
    4. dst,
    5. ratio,
    6. valid_from,
    7. valid_to
    8. FROM edge
    9. WHERE '2024-12-31' >= valid_from
    10. AND (valid_to IS NULL OR '2024-12-31' < valid_to)
    11. ORDER BY src, dst, confidence DESC, collected_at DESC
    12. ),
    13. chain AS (
    14. SELECT
    15. 'U1'::text AS root,
    16. e.dst AS current_node,
    17. e.ratio AS ratio,
    18. 2 AS depth,
    19. ARRAY['U1', e.dst] AS path
    20. FROM valid_edge e
    21. WHERE e.src = 'U1'
    22. AND e.dst <> 'U1'
    23. UNION ALL
    24. SELECT
    25. c.root,
    26. e.dst AS current_node,
    27. c.ratio * e.ratio AS ratio,
    28. c.depth + 1 AS depth,
    29. c.path || e.dst AS path
    30. FROM chain c
    31. JOIN valid_edge e
    32. ON e.src = c.current_node
    33. WHERE c.depth < 20
    34. AND c.ratio * e.ratio >= 0.0001
    35. AND NOT e.dst = ANY(c.path)
    36. )
    37. SELECT
    38. current_node AS entity,
    39. SUM(ratio) AS total_ratio
    40. FROM chain
    41. GROUP BY current_node
    42. ORDER BY total_ratio DESC;

    Different databases support arrays, paths, and ANY differently, so at implementation time these must be replaced with equivalent constructs. The principle remains the same: the path must include all visited nodes, and self-loops must be explicitly excluded.

    4.4 Graph Database Traversal Approach

    Mainstream graph databases generally support path traversal, shortest-path queries, path filtering, and similar capabilities. In an equity-penetration scenario you should explicitly select “all paths,” rather than defaulting to only the shortest path.

    Illustrative logic:

    1. Starting from root, traverse along holding edges, path length 1 to max_depth;
    2. Keep only paths where each node does not repeat within the path;
    3. Keep only edges valid at the query time point;
    4. Return each path's node sequence and edge properties;
    5. Compute each path's ratio product at the application layer, and aggregate and sum by endpoint.

    If a graph database supports materialized paths or intermediate results, layer-by-layer aggregation results can be written to a temporary graph or results table to avoid repeatedly expanding the same subgraph.

    5. Complex Scenarios and a Common-Error Validation Checklist

    5.1 Cycles and Cross-Shareholding

    Cycles are a common risk signal in ownership networks. In engineering terms it is recommended to:

    1. Disallow repeated nodes within each path, ensuring the set of simple paths is finite;
    2. Output detected cycles separately as hints of cross-shareholding, circular investment, or hidden control;
    3. Make the definition explicit: whether to use simple-path summation or ring-weighted iteration;
    4. Within the same system, always fix the definition, avoiding two different answers to the same question.

    5.2 Limited Partnerships and Fund Structures

    In a limited partnership, the GP (general partner) usually holds the authority to manage affairs, while the LP (limited partner) usually only contributes capital and does not participate in management. Therefore, control cannot be judged by contribution ratio alone.

    It is recommended to calculate the following chains separately:

    • Ownership-ratio penetration;
    • Voting-ratio penetration;
    • Control determination;
    • Income rights or interest attribution.

    For fund-of-funds, sub-funds, and multi-layer nested funds, layered display can be combined with maximum depth and minimum-holding thresholds.

    5.3 Dual-Class Shares and Voting Proxies

    Dual-class shares, voting proxies, and concerted-action agreements cause ownership ratios and voting ratios to diverge. During modeling, each edge should store both:

    • Ownership ratio;
    • Voting ratio;
    • Right type;
    • Validity period;
    • The proxy or agreement basis.

    Control penetration should also incorporate non-equity factors such as board seats, agreement arrangements, nomination rights, and veto rights.

    5.4 Common Errors and Validation Checklist

    Common error Possible result Validation method
    Merging multiple paths then multiplying Severely underestimates the penetrated ratio Construct a multi-path sample and check against hand calculation
    Duplicate edges not deduplicated Double counting Check uniqueness of (src, dst, as_of)
    Incomplete path array Missed self-loops or cycles Use a path set that includes both start and end nodes
    Query time point not bounded Historical or future holdings wrongly counted Check effective/expiry dates for every input edge
    Early termination too soon Missing cumulative ratio Compare the number of output paths against a hand-calculated baseline
    Missing ratio treated as 0 or 1 Distorted results Count the proportion of nulls and enter a data-completion process
    Confusing ownership with voting Misjudged control Run both penetrations separately and compare
    GP/LP not distinguished Misjudged control Validate GP identification rules and agreement fields

    6. Data Quality and Intelligent Assistance

    6.1 Entity Resolution

    Dirty data in ownership networks commonly includes name changes, mixed use of abbreviations and full names, differences between traditional and simplified characters, coexistence of Chinese and English, typos, and multiple business records for the same entity.

    It is recommended to build an entity normalization layer:

    • Use strong identifiers such as the unified social credit code as the primary key;
    • Supplement with fuzzy matching using name similarity, address, historical names, legal representative, contact phone, and more;
    • Preserve original names and original sources to ensure traceability;
    • Output candidate relationships for suspected duplicate entities, and do not automatically merge high-conflict entities.

    6.2 Multi-Source Conflict Resolution

    Registration data, announcements, annual reports, and third-party data may disagree. It is recommended to:

    • Set priorities by source credibility and timeliness;
    • Retain all candidate records;
    • Output confidence and conflict reasons;
    • Route major conflicts to manual review;
    • Do not silently select a single source.

    6.3 Unstructured Information Extraction

    Prospectuses, announcements, annual reports, and due diligence reports contain a large amount of equity information. Models can be used to extract “entity–relationship–ratio–date” quadruples, but the results must go through structured validation.

    A recommended tiered strategy:

    • For complex cross-document comparison and long-text summarization, a more capable model can be used;
    • For fixed-format, large-volume extraction tasks, a lightweight model combined with rule templates can be used;
    • Extraction results must pass schema validation, value-range validation, and manual spot checks;
    • It is not recommended to write model output directly into the graph database without validation.

    Model capabilities, APIs, and evaluation details should be based on official documentation and actual testing, and capability boundaries should not be judged solely from marketing materials.

    7. Performance, Selection, and Engineering Optimization

    7.1 Selection Recommendations

    Relational and graph databases are not absolutely better or worse; it depends on data scale, query patterns, operations capability, and benchmark results.

    Option Suitable scenarios Notes
    Relational recursive CTE Medium data scale, existing relational governance Control depth, path-array cost, and recursion overhead
    Graph database Strong needs for multi-hop traversal, path tracing, cycle detection Assess version, ecosystem, operations, and query patterns
    Materialized results table High-frequency fixed queries, stable hierarchy Requires change events to trigger incremental updates
    Hybrid architecture Authoritative business data in a relational store, graph computation in the service layer Align the two stores with a unified entity ID

    7.2 Engineering Optimization

    • Layered materialization: precompute penetration results for entities with shallow hierarchies and few changes;
    • Incremental updates: driven by ownership-change events, recompute only the affected subgraph;
    • Caching: cache results for high-frequency queried entities, with an invalidation policy;
    • Indexing: build indexes on entity, time point, edge type, and source;
    • Explainable output: return full paths, per-hop ratios, sources, time points, and confidence;
    • Visualization: display the ownership tree by hierarchy, with cycles and cross-shareholding highlighted prominently.

    7.3 Cloud Deployment Recommendations

    A production-grade equity-penetration service can adopt a general cloud architecture:

    • Object storage holds raw documents, snapshots, and audit logs;
    • A message queue carries ownership-change events to enable asynchronous incremental computation;
    • A container platform runs computation tasks and scales elastically by load;
    • A graph database or columnar storage handles relationship traversal and batch statistics respectively;
    • A log service with monitoring and alerting tracks slow queries, data-missing rates, and cycle-hit rates.

    Specific product selection, specifications, and pricing should be based on official documentation and benchmark testing. The cloud capabilities described in this article are only a general architecture example and do not constitute a selection recommendation.

    8. Pre-Launch Validation Checklist

    Before going live, it is recommended to complete at least the following tests:

    1. Single-path penetration: results match hand calculation;
    2. Multi-path penetration: different paths are calculated separately and then summed;
    3. Cycles and self-loops: cycles are detected, and paths are not expanded repeatedly;
    4. Duplicate edges: the same (src, dst) is not counted twice;
    5. Time-point queries: results before and after a change match expectations;
    6. Maximum depth: paths reaching the depth limit are flagged separately;
    7. Threshold pruning: differences before and after pruning are explainable;
    8. Missing ratios: missing data is not silently treated as 0 or 1;
    9. Voting-rights penetration: results can be output separately from ownership-ratio penetration;
    10. Audit output: each result can be traced back to nodes, edges, ratios, sources, and time.

    9. Summary

    Equity penetration may look like simply calculating downward along a chain, but it is actually a composite engineering effort spanning data modeling, graph algorithms, data governance, and audit compliance. To build a reliable service, four points must be grasped:

    1. Modeling first: unify entity identifiers, and give edges time, source, and confidence;
    2. Complete paths: calculate multiple paths separately and then sum, avoiding merge-then-multiply;
    3. Justified pruning: pruning can optimize performance, but does not guarantee linear complexity;
    4. Traceable results: output paths, ratios, sources, and time points to meet audit and compliance requirements.

    As long as the four elements of time, paths, pruning, and traceability are handled properly, equity-penetration computation can remain stable, trustworthy, and reviewable even in complex ownership networks.