All projects

TraceNet

Antibiotic resistance modelled as a graph: where it spreads, which communities are most exposed, and where containment should start.

Kind
Graph algorithms study
Year
2026
Area
Care
Built with
  • Python
  • C++
  • TypeScript
  • Next.js
  • Graph algorithms
  • CARD resistance data

The question

If a resistance gene appears in one species, where can it travel, and which links should be cut first?

TraceNet answers with textbook graph algorithms, one question per method.

Why it exists

Resistance genes move between bacteria through plasmids, so the spread is naturally a graph. TraceNet was built for an algorithms course and asks which paths matter most and which links to cut first, using classical methods only.

How it works

From resistance data to a containment plan

  1. 1

    CARD data

    Resistance genes found on plasmids for 16 bacterial species.

  2. 2

    Graph

    Species are joined by shared genes, weighted by similarity and by how related the species are.

  3. 3

    Questions

    Classical algorithms answer one question each.

    Reach and groups
    BFS, DFS and strongly connected components.
    Routes
    Dijkstra and Floyd–Warshall, where the shortest path is the most probable one.
    Order and matching
    Topological sort and Boyer–Moore.
  4. 4

    Containment

    Greedy for the full graph, branch-and-bound for exact answers on small subgraphs.

Decisions

  • Plasmid-borne genes only

    The graph keeps only resistance genes found on plasmids, because genes on the chromosome are not passed between species this way.

  • The shortest path is the most probable path

    Edge weights are turned into costs with a negative logarithm, so adding up costs along a path multiplies the probabilities, and Dijkstra and Floyd–Warshall return the likeliest spread.

  • Relatedness adjusts the weight

    Species of the same genus keep their full weight, the same Gram class gets 0.75 of it and the rest 0.5.

Evidence

  • Built

    The graph builder, the C++17 engine with its own tests and the Next.js visualiser with eight guided chapters are all in the repository.

Trade-offs and limits

  • Exact containment by branch-and-bound grows exponentially with the number of links removed, so it is meant for small subgraphs; the greedy method is the one that scales.

Built with

Languages

  • Python
  • C++
  • TypeScript

Frameworks and libraries

  • Next.js

Data and storage

  • CARD resistance data

Methods

  • Graph algorithms