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, 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.4

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)](https://misiones.cubaminrex.cu/sites/default/files/styles/750_ancho/public/imagenes/editoronu/articulos/carlos-j-finlay_0.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:

Triangle detection in a graph is performed using a Depth-First Search (DFS) combined with a coloring scheme. As the DFS traverses the graph, each visited node colors its uncolored neighbors with unique integers. A triangle is identified when two adjacent nodes share two colored neighbors whose colors form a triangle.

## Runtime Analysis:

  1. _Depth-First Search (DFS)_: A standard Depth-First Search (DFS) 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 Behavior:_ During the Depth-First Search (DFS), each node performs either color assignment or a constant-time check of its neighbors' colors. Since this operation is executed for each vertex during the DFS traversal, the overall computational complexity remains $O(mid V mid + mid E mid)$, equivalent to the standard DFS algorithm's worst-case running time.
  3. _Overall Runtime:_ The combined Depth-First Search (DFS), 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).

---

## Find and Count All Triangles - Runtime $O(n + m)$

The -a flag enables the discovery of all triangles within the graph.

Example:

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

Output:

` testMatrix2.txt: Triangles Found ('0', '2', '8') ; ('0', '1', '10') ; ('0', '2', '3') ; ('0', '1', '7') ; ('0', '2', '10') ; ('1', '3', '10') ; ('2', '3', '10') ; ('1', '3', '8') ; ('0', '3', '10') ; ('3', '4', '10') ; ('0', '3', '8') ; ('0', '1', '8') ; ('2', '3', '8') ; ('0', '1', '5') ; ('3', '4', '8') ; ('0', '1', '3' `

When multiple triangles exist, the output provides a list of their vertices.

Similarly, the -c flag counts all triangles in the graph.

Example:

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

Output:

` testMatrix2.txt: Triangles Count 16 `

## Runtime Analysis:

We employ the same algorithm used to solve the triangle-free problem.

---

# 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 [-a] [-b] [-c] [-v] [-l] [--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
-a, --all identify all triangles
-b, --bruteForce
 compare with a brute-force approach using matrix multiplication
-c, --count count the total amount of triangles
-v, --verbose anable verbose output
-l, --log enable file logging
--version show program's version number and exit

```

This output describes all available options.

## The Finlay Testing Application

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] [-a] [-b] [-c] [-w] [-v] [-l] [--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)
-a, --all identify all triangles
-b, --bruteForce
 compare with a brute-force approach using matrix multiplication
-c, --count count the total amount of triangles
-w, --write write the generated random matrix to a file in the current directory
-v, --verbose anable verbose output
-l, --log enable file logging
--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. + The algorithm for the Triangle-Free Problem can be adapted to identify and count all triangles in O(n + m) time. + This algorithm provides multiple of applications to other computational problems in combinatorial optimization and computational geometry. `

---

# License

  • MIT.

Size

15.1 KB

Downloads

5

Status  Completed
Checksum (MD5) fc3fcc1a98ad75c41c3cc5b8efb20946
Checksum (SHA-1) a6a03a4d08eab4c6ac3902d7c457d1970b1b5d2a
Checksum (SHA-256) d247212633af4ccc8b0363024885338fa375f516d1cc68c585643efa968e5762
Checksum (SHA-512) ea22a62294b2cecd91825c56daedd51394ed7821728eac62175224cfa302c528df…
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-014-py3-none-anywhl-mzdp
Unique Id jBaOcZlcP6sRhHxc
Version (Raw) 0.1.4
Version (Parsed)
  • Major: 0
  • Minor: 1
  • Patch: 4
  • 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 numpy>=2.2.1 | scipy>=1.15.0
Requires Python >=3.8
pkg aegypti-0.1.4-py3-none-any.whl 5
15.1 KB
md5 sha1 sha256 sha512
Package Contents (aegypti-0.1.4-py3-none-any.whl)
Loading...

This package has 16 files/directories.

 Newer Python logo
aegypti
 0.2.4
4 Fetched by Cloudsmith
 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
  Python logo
aegypti
 0.1.4
5 Fetched by Cloudsmith
 Older Python logo
aegypti
 0.1.3
5 Fetched by Cloudsmith
 Older 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

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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4/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.4 ...

pip install 'aegypti==0.1.4'

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.4

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.4

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.4
Warning: We highly recommend using pip (or similar) rather than installing directly.
Top