Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Build Status codecov Docs

This package implements generic tensor networks to compute solution space properties of a class of hard combinatorial optimization problems. The solution space properties include

  • The maximum/minimum solution sizes,
  • The number of solutions at certain sizes,
  • The enumeration/sampling of solutions at certain sizes.

The solvable problems include Independent set problem, Maximal independent set problem, Spin-glass problem, Cutting problem, Vertex matching problem, Binary paint shop problem, Coloring problem, Dominating set problem, Set packing problem, Satisfiability problem and Set covering problem.


GenericTensorNetworks is a   Julia Language   package. To install GenericTensorNetworks, please open Julia's interactive session (known as REPL) and press ] key in the REPL to use the package mode, then type

pkg> add GenericTensorNetworks

To update, just type up in the package mode.

We recommend you to use Julia version >= 1.7, otherwise your program can suffer from significant (exponential in tensor dimension) overheads when permuting the dimensions of a large tensor. If you have to use an older version Julia, you can overwrite the LinearAlgebra.permutedims! by adding the following patch to your own project.

# only required when your Julia version < 1.7
using TensorOperations, LinearAlgebra
function LinearAlgebra.permutedims!(C::Array{T,N}, A::StridedArray{T,N}, perm) where {T,N}
    if isbitstype(T)
        TensorOperations.tensorcopy!(A, ntuple(identity,N), C, perm)
        invoke(permutedims!, Tuple{Any,AbstractArray,Any}, C, A, perm)

Supporting and Citing

Much of the software in this ecosystem was developed as part of academic research. If you would like to help support it, please star the repository as such metrics may help us secure funding in the future. If you use our software as part of your research, teaching, or other activities, we would be grateful if you could cite our work. The CITATION.bib file in the root of this repository lists the relevant papers.

Questions and Contributions

You can

  • Post a question on Julia Discourse forum, pin the package maintainer wih @1115.
  • Discuss in the #graphs channel of the Julia Slack, ping the package maintainer with @JinGuo Liu.
  • Open an issue if you encounter any problems, or have any feature request.