Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nsailor/fastgraphlettransform.jl
Julia wrapper for the Fast Graphlet Transform.
https://github.com/nsailor/fastgraphlettransform.jl
Last synced: 19 days ago
JSON representation
Julia wrapper for the Fast Graphlet Transform.
- Host: GitHub
- URL: https://github.com/nsailor/fastgraphlettransform.jl
- Owner: nsailor
- License: mpl-2.0
- Created: 2020-08-26T09:16:45.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-28T19:33:46.000Z (8 months ago)
- Last Synced: 2024-09-29T00:06:19.054Z (about 1 month ago)
- Language: Julia
- Size: 41 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FastGraphletTransform.jl
Julia wrapper for the [Fast Graphlet Transform](https://github.com/fcdimitr/fglt) C++/Cilk implementation.
[![Build Status](https://github.com/nsailor/FastGraphletTransform.jl/workflows/CI/badge.svg)](https://github.com/nsailor/FastGraphletTransform.jl/actions)
[![Coverage](https://codecov.io/gh/nsailor/FastGraphletTransform.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/nsailor/FastGraphletTransform.jl)
[![License: MPL-2.0](https://img.shields.io/badge/License-MPLv2-blue)](https://www.mozilla.org/en-US/MPL/)## Installation
To add the package to your Julia environment, open a Julia prompt, enter the `pkg` mode by pressing `]`, and type:
```julia
add FastGraphletTransform
```## Usage
To perform a fast graphlet transform, call the `fglt` function with the graph's adjacency matrix, for instance:
```julia
julia> using FastGraphletTransformjulia> using SparseArrays
julia> A = sparse([0 1 0 0 1 0; 1 0 1 1 1 0; 0 1 0 1 1 0; 0 1 1 0 1 1; 1 1 1 1 0 0; 0 0 0 1 0 0])
6×6 SparseMatrixCSC{Int64,Int64} with 18 stored entries:
⋅ 1 ⋅ ⋅ 1 ⋅
1 ⋅ 1 1 1 ⋅
⋅ 1 ⋅ 1 1 ⋅
⋅ 1 1 ⋅ 1 1
1 1 1 1 ⋅ ⋅
⋅ ⋅ ⋅ 1 ⋅ ⋅julia> (f, fn) = fglt(A);
Total elapsed time: 0.0000 secjulia> f # Raw frequencies (n x 16)
6×16 Matrix{Int64}:
1 2 6 1 1 14 4 6 0 6 4 0 2 2 0 0
1 4 9 6 4 12 19 7 4 3 12 8 5 3 5 1
1 3 9 3 3 14 12 9 1 5 12 3 4 4 3 1
1 4 8 6 3 12 18 7 4 5 10 6 4 4 3 1
1 4 9 6 4 12 19 7 4 3 12 8 5 3 5 1
1 1 3 0 0 8 0 3 0 3 0 0 0 0 0 0julia> fn # Net frequencies (n x 16)
6×16 Matrix{Int64}:
1 2 4 0 1 2 0 0 0 2 0 0 0 2 0 0
1 4 1 2 4 0 1 0 0 0 2 1 0 0 2 1
1 3 3 0 3 0 0 0 0 0 4 0 0 1 0 1
1 4 2 3 3 0 2 0 0 0 2 3 0 1 0 1
1 4 1 2 4 0 1 0 0 0 2 1 0 0 2 1
1 1 3 0 0 2 0 0 0 3 0 0 0 0 0 0
```