Package Search Help

You can use boolean logic (e.g. AND/OR/NOT) for complex search queries. For more help and examples, see the search documentation.

Search by package name:
my-package (implicit)
name:my-package (explicit)

Search by package filename:
filename:my-package.ext 

Search by package tag:
tag:latest 

Search by package version:
version:1.0.0  prerelease:true (prereleases)
prerelease:false (no prereleases)

Search by package architecture:
architecture:x86_64 

Search by package distribution:
distribution:el 

Search by package license:
license:MIT 

Search by package format:
format:deb 

Search by package status:
status:in_progress 

Search by package file checksum:
checksum:5afba 

Search by package security status:
severity:critical 

Search by package vulnerabilities:
vulnerabilities:>1 
vulnerabilities:<1000 

Search by # of package downloads:
downloads:>8 
downloads:<100 

Search by package type:
type:binary 
type:source 

Search by package size (bytes):
size:>50000 
size:<10000 

Search by dependency name/version:
dependency:log4j 
dependency:log4j=1.0.0 
dependency:log4j>1.0.0 

Search by uploaded date:
uploaded:>"1 day ago" 
uploaded:<"August 14, 2022 EST" 

Search by entitlement token (identifier):
entitlement:3lKPVJPosCsY 

Search by policy violation:
policy_violated:true
deny_policy_violated:true
license_policy_violated:true
vulnerability_policy_violated:true

Search by repository:
repository:repo-name

Search by last download date:
last_downloaded:<"30 days ago" 
last_downloaded:>"August 14, 2022 EST" 

Search queries for all Debian-specific (and related) package types

Search by component:
deb_component:unstable

Search queries for all Maven-specific (and related) package types

Search by group ID:
maven_group_id:org.apache

Search queries for all Docker-specific (and related) package types

Search by image digest:
docker_image_digest:sha256:7c5..6d4
(full hashref only)

Search by layer digest:
docker_layer_digest:sha256:4c4..ae4
(full hashref only)

Search queries for all Generic-specific package types

Search by file path:
generic_filepath:path/to/file.txt

Search by directory:
generic_directory:path/to

Field type modifiers (depending on the type, you can influence behaviour)

For all queries, you can use:
~foo for negation

For string queries, you can use:
^foo to anchor to start of term
foo$ to anchor to end of term
foo*bar for fuzzy matching

For number/date or version queries, you can use:
>foo for values greater than
>=foo for values greater / equal
<foo for values less than
<=foo for values less / equal

Need a secure and centralised artifact repository to deliver Alpine, Cargo, CocoaPods, Composer, Conan, Conda, CRAN, Dart, Debian, Docker, Generic, Go, Helm, Hex, HuggingFace, LuaRocks, Maven, MCP, npm, NuGet, P2, Python, RedHat, Ruby, Swift, Terraform, Vagrant, VSX, Raw & More packages?

Cloudsmith is the new standard in Package / Artifact Management and Software Distribution.

With support for all major package formats, you can trust us to manage your software supply chain.

Start My Free Trial

Python logo aegypti  0.1.2

One-liner (summary)

Solve the Triangle-Free Problem for an undirected graph represented by a Boolean adjacency matrix given in a file.

Description

# Triangle-Free Solver

![Honoring the Memory of Carlos Juan Finlay (Pioneer in the research of yellow fever)](docs/finlay.jpg)

This work builds upon [The Triangle Finding Problem](https://www.researchgate.net/publication/387698746_The_Triangle_Finding_Problem).

# Triangle-Free Problem

The Triangle-Free problem is a fundamental decision problem in graph theory. Given an undirected graph, the problem asks whether it's possible to determine if the graph contains no triangles (cycles of length 3). In other words, it checks if there exists a configuration where no three vertices are connected by edges that form a closed triangle.

This problem is important for various reasons:

  • Graph Analysis: It's a basic building block for more complex graph algorithms and has applications in social network analysis, web graph analysis, and other domains.
  • Computational Complexity: It serves as a benchmark problem in the study of efficient algorithms for graph properties. While the naive approach has a time complexity of $O(n^3)$, there are more efficient algorithms with subcubic complexity.

Understanding the Triangle-Free problem is essential for anyone working with graphs and graph algorithms.

## Problem Statement

Input: A Boolean Adjacency Matrix $M$.

Question: Does $M$ contain no triangles?

Answer: True / False

### Example Instance: 5 x 5 matrix

| c0 | c1 | c2 | c3 | c4 |
------ | ----- | --- | ----- | --- | --- |
r0 | 0 | 0 | 1 | 0 | 1 |
r1 | 0 | 0 | 0 | 1 | 0 |
r2 | 1 | 0 | 0 | 0 | 1 |
r3 | 0 | 1 | 0 | 0 | 0 |
r4 | 1 | 0 | 1 | 0 | 0 |

A matrix is represented in a text file using the following string representation:

` 00101 00010 10001 01000 10100 `

This represents a 5x5 matrix where each line corresponds to a row, and '1' indicates a connection or presence of an element, while '0' indicates its absence.

_Example Solution:_

Triangle Found (0, 2, 4): In Rows 2 & 4 and Columns 0 & 2

---

# Our Algorithm - Runtime $O(n + m)$

## The algorithm explanation:

We detect triangles in a graph using a Breadth-First Search (BFS) and a coloring scheme. During the BFS traversal, each visited node assigns unique, consecutive integer colors to its uncolored neighbors. A triangle exists if two adjacent nodes share two colored neighbors, and the colors assigned to these shared neighbors are the same.

## Runtime Analysis:

  1. _Breadth-First Search (BFS)_: A standard Breadth-First Search (BFS) on a graph with $mid V mid$ vertices and $mid E mid$ edges has a time complexity of $O(mid V mid + mid E mid)$, where $mid ldots mid$ represents the cardinality (e.g., $n = mid V mid$ and $m = mid E mid$). This is because in the worst case, we visit every vertex and explore every edge.
  2. _Coloring and Checking for Color Difference:_ In the Breadth-First Search (BFS), each node performs either color assignment or a constant-time check of color differences with its neighbors. Because this operation is executed for every vertex during the BFS traversal, the overall computational complexity remains equivalent to the standard BFS algorithm's worst-case running time.
  3. _Overall Runtime:_ The combined breadth-first search, coloring, and checking process has a time complexity of $O(mid V mid + mid E mid)$.

# Compile and Environment

## Install Python >=3.8.

## Install Aegypti's Library and its Dependencies with:

`bash pip install aegypti `

---

# Execute

---

  1. Go to the package directory to use the benchmarks:

`bash git clone https://github.com/frankvegadelgado/finlay.git cd finlay `

  1. Execute the script:

`bash triangle -i .\benchmarks\testMatrix1.txt `

utilizing the triangle command provided by Aegypti's Library to execute the Boolean adjacency matrix finlaybenchmarkstestMatrix1.txt. The file testMatrix1.txt represents the example described herein. We also support .xz, .lzma, .bz2, and .bzip2 compressed .txt files.

## The console output will display:

` testMatrix1.txt: Triangle Found ('0', '2', '4') `

which implies that the Boolean adjacency matrix finlaybenchmarkstestMatrix1.txt contains a triangle combining the coordinates (0, 2, 4).

# Partial Feedback Edge Set Problem - Runtime $O(n + m)$

The -c flag enables counting the size of the approximate minimum edge cover of all triangles. This is related to the Partial Feedback Edge Set problem, which is NP-complete [Yannakakis, 1978](https://dl.acm.org/doi/10.1145/800133.804355).

Example:

`bash triangle -i .\benchmarks\testMatrix2.txt -c `

Output:

` testMatrix2.txt: Cover Size 10 `

## Runtime Analysis:

To prove that a graph is triangle-free, we utilize the same algorithmic approach as in the previous scenario. Consequently, establishing an $O(m+n)$ time complexity for triangle-free graph detection would suffice, as this algorithm is shared between both cases.

# Command Options

To display the help message and available options, run the following command in your terminal:

`bash triangle -h `

This will output:

``` usage: triangle [-h] -i INPUTFILE [-b] [-v] [-l] [-c] [--version]

Solve the Triangle-Free Problem for an undirected graph represented by a Boolean adjacency matrix given in a file.

options:
-h, --help show this help message and exit
-i INPUTFILE, --inputFile INPUTFILE
 input file path
-b, --bruteForce
 enable comparison with a brute-force approach using matrix multiplication
-v, --verbose anable verbose output
-l, --log enable file logging
-c, --coverTriangle
 Enable counting the size of the approximate minimum edge cover of all triangles. This is related to the Partial Feedback Edge Set problem, which is NP-complete (Yannakakis, 1978, doi:10.1145/800133.804355).
--version show program's version number and exit

```

This output describes all available options.

---

A command-line tool, test_triangle, has been developed for testing algorithms on randomly generated, large sparse matrices. It accepts the following options:

``` usage: test_triangle [-h] -d DIMENSION [-n NUM_TESTS] [-s SPARSITY] [-b] [-w] [-v] [-l] [-c] [--version]

The Finlay Testing Application.

options:
-h, --help show this help message and exit
-d DIMENSION, --dimension DIMENSION
 an integer specifying the dimensions of the square matrices
-n NUM_TESTS, --num_tests NUM_TESTS
 an integer specifying the number of tests to run
-s SPARSITY, --sparsity SPARSITY
 sparsity of the matrices (0.0 for dense, close to 1.0 for very sparse)
-b, --bruteForce
 enable comparison with a brute-force approach using matrix multiplication
-w, --write write the generated random matrix to a file in the current directory
-v, --verbose anable verbose output
-l, --log enable file logging
-c, --coverTriangle
 Enable counting the size of the approximate minimum edge cover of all triangles. This is related to the Partial Feedback Edge Set problem, which is NP-complete (Yannakakis, 1978, doi:10.1145/800133.804355).
--version show program's version number and exit

```

This tool is designed to benchmark algorithms for sparse matrix operations.

It generates random square matrices with configurable dimensions (-d), sparsity levels (-s), and number of tests (-n). While a comparison with a brute-force matrix multiplication approach is available, it's recommended to avoid this for large datasets due to performance limitations. Additionally, the generated matrix can be written to the current directory (-w), and verbose output or file logging can be enabled with the (-v) or (-l) flag, respectively, to record test results.

# Code

  • Python code by Frank Vega.

# Complexity

`diff + We propose an O(n + m) algorithm to solve the Triangle-Free Problem. + This algorithm provides multiple of applications to other computational problems in combinatorial optimization and computational geometry. `

# License

  • MIT.

Size

16.8 KB

Downloads

5

Status  Completed
Checksum (MD5) 946a98f744f4eda18e8d7783dca4dff3
Checksum (SHA-1) af1dfe968de56c97f67412319a563e33b10d3c2f
Checksum (SHA-256) 9f54b2ea50d5a300d0187dec9644aa7fa0739e51113d57a534b8eb0ff970c962
Checksum (SHA-512) 986d9e77e4c13b78fc8110eea011f0b078f9a0539d1a564149d3c87364fba2bf2e…
GPG Signature
GPG Fingerprint 6811684bac0b8895434e97bdd4391b8fb999e537
Storage Region  Dublin, Ireland
Type  Binary (contains binaries and binary artifacts)
Uploaded At 4 months, 3 weeks ago
Uploaded By Fetched by Cloudsmith
Slug Id aegypti-012-py3-none-anywhl-weor
Unique Id cOOjofdcoGOLyIoR
Version (Raw) 0.1.2
Version (Parsed)
  • Major: 0
  • Minor: 1
  • Patch: 2
  • Type: SemVer (Compat)
  extended metadata
Author Frank Vega <vega.frank@gmail.com>
Classifiers Development Status :: 3 - Alpha | Environment :: Console | Environment :: Web Environment | Intended Audience :: Developers | Intended Audience :: Science/Research | License :: OSI Approved :: MIT License | Programming Language :: Python :: 3.10
Homepage URL https://github.com/frankvegadelgado/finlay
Metadata Version 2.2
Project Urls Source Code, https://github.com/frankvegadelgado/finlay
Py Filetype bdist_wheel
Py Version py3
Requires Dist networkx>=3.4.2 | numpy>=2.2.1 | scipy>=1.15.0
Requires Python >=3.8
pkg aegypti-0.1.2-py3-none-any.whl 5
16.8 KB
md5 sha1 sha256 sha512
Package Contents (aegypti-0.1.2-py3-none-any.whl)
Loading...

This package has 17 files/directories.

 Newer Python logo
aegypti
 0.2.3
5 Fetched by Cloudsmith
 Newer Python logo
aegypti
 0.2.2
5 Fetched by Cloudsmith
 Newer Python logo
aegypti
 0.2.1
5 Fetched by Cloudsmith
 Newer Python logo
aegypti
 0.2.0
5 Fetched by Cloudsmith
 Newer Python logo
aegypti
 0.1.9
4 Fetched by Cloudsmith
 Newer Python logo
aegypti
 0.1.8
5 Fetched by Cloudsmith
 Newer Python logo
aegypti
 0.1.7
5 Fetched by Cloudsmith
 Newer Python logo
aegypti
 0.1.6
5 Fetched by Cloudsmith
 Newer Python logo
aegypti
 0.1.5
5 Fetched by Cloudsmith
 Newer Python logo
aegypti
 0.1.4
5 Fetched by Cloudsmith
  Python logo
aegypti
 0.1.2
5 Fetched by Cloudsmith
 Older Python logo
aegypti
 0.1.1
4 Fetched by Cloudsmith
 Older Python logo
aegypti
 0.1.0
5 Fetched by Cloudsmith
 Older Python logo
aegypti
 0.0.9
4 Fetched by Cloudsmith
 Older Python logo
aegypti
 0.0.8
5 Fetched by Cloudsmith
 Older Python logo
aegypti
 0.0.7
5 Fetched by Cloudsmith
 Older Python logo
aegypti
 0.0.6
5 Fetched by Cloudsmith
 Older Python logo
aegypti
 0.0.5
5 Fetched by Cloudsmith
 Older Python logo
aegypti
 0.0.4
5 Fetched by Cloudsmith
 Older Python logo
aegypti
 0.0.3
4 Fetched by Cloudsmith

Last scanned

4 months, 3 weeks ago

Scan result

Clean

Vulnerability count

0

Max. severity

Unknown

You can embed a badge in another website that shows this or the latest version of this package.

To embed the badge for this specific package version, use the following:

[![This version of 'aegypti' @ Cloudsmith](https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/aegypti/0.1.2/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/?render=true)](https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/aegypti/0.1.2/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/)
|This version of 'aegypti' @ Cloudsmith|
.. |This version of 'aegypti' @ Cloudsmith| image:: https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/aegypti/0.1.2/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/?render=true
   :target: https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/aegypti/0.1.2/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/
image::https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/aegypti/0.1.2/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/?render=true[link="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/aegypti/0.1.2/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/",title="This version of 'aegypti' @ Cloudsmith"]
<a href="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/aegypti/0.1.2/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/"><img src="https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/aegypti/0.1.2/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/?render=true" alt="This version of 'aegypti' @ Cloudsmith" /></a>

rendered as: This version of 'aegypti' @ Cloudsmith

To embed the badge for the latest package version, use the following:

[![Latest version of 'aegypti' @ Cloudsmith](https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/aegypti/latest/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/?render=true&show_latest=true)](https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/aegypti/latest/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/)
|Latest version of 'aegypti' @ Cloudsmith|
.. |Latest version of 'aegypti' @ Cloudsmith| image:: https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/aegypti/latest/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/?render=true&show_latest=true
   :target: https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/aegypti/latest/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/
image::https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/aegypti/latest/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/?render=true&show_latest=true[link="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/aegypti/latest/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/",title="Latest version of 'aegypti' @ Cloudsmith"]
<a href="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/aegypti/latest/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/"><img src="https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/aegypti/latest/a=noarch;xf=bdist_wheel;xn=aegypti;xv=py3/?render=true&show_latest=true" alt="Latest version of 'aegypti' @ Cloudsmith" /></a>

rendered as: Latest version of 'aegypti' @ Cloudsmith

These instructions assume you have setup the repository first (or read it).

To install/use aegypti @ version 0.1.2 ...

pip install 'aegypti==0.1.2'

You can also install the latest version of this package:

pip install --upgrade 'aegypti'

If necessary, you can specify the repository directly:

pip install \
  --index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/ \
  aegypti==0.1.2

If you've got a project requirements.txt file, you can specify this as a dependency:

--index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/
aegypti==0.1.2

In addition, you can use this repository as an extra index url. However, please read our documentation on this parameter before using it. For example in a requirements.txt file:

--extra-index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/
aegypti==0.1.2
Warning: We highly recommend using pip (or similar) rather than installing directly.
Top