Skip to main content

A Python package for Ideal Flow Network computations

Project description

Ideal Flow Network Python Library

PyPI version License: GPL v3 Documentation Twitter Follow Telegram Discord

The IdealFlowNetwork Python package provides powerful tools for creating and managing Ideal Flow Networks (IFN). An Ideal Flow Network is a strongly connected network where the flows are balanced. This concept is linked to how we think about honesty, integrity, and the long-term consequences of our actions, touching upon morality and spirituality. By understanding how systems work, we can make better decisions that align with these values.

Table of Contents

What is Ideal Flow Network?

An Ideal Flow Network (IFN) is a theoretical model where the network is strongly connected, and the flows are balanced and conserved. Mathematically, it represents a steady-state relative flow distribution in a directed graph. The IFN theory was first proposed by Kardi Teknomo in 2015.

IFNs have profound implications in various fields, including transportation networks, communication networks, health science, agricultural ecology, data science, machine learning, artificial intelligence, systems thinking, philosophy, and more.

For a special application to transportation planning, check out the traffic assignment software IFN-Transport.

Features

  • Flexible and Scalable Modules: Includes Network, Classifier, Text, and Table modules designed for various network analysis applications.
  • Data Management: Functions for managing data, manipulating network structures, and querying network information.
  • Comprehensive Analysis Tools: Methods for analyzing and manipulating nodes, links, adjacency lists, matrices, and performing network analysis and metrics.
  • Advanced Algorithms: Includes path finding, cycle analysis, connectivity analysis, signature computations, and more.

Installation

You can install the package using pip:

pip install IdealFlowNetwork

Check out the package on PyPI.

Latest Stable Version: 1.5.5

Alternatively, download the zip file from GitHub, unzip the file in a folder.

  1. Go to folder pkg
cd *your_folder_name*`/pkg`
  1. In command Prompt
> pip install . 

It copies the package files to your Python environment.

Getting Started

Here's a simple example to get you started:

import IdealFlow.Network as net

# Initialize an Ideal Flow Network
n = net.IFN()

# Build network simply by adding links or trajectories
n.add_link('a','b')
n.add_link('b','c')
n.add_link('c','a')
trajectory =  ['a','b','c','d','e','a']
n.assign(trajectory)

# Show the adjacency list
print(n)

# Extract matrix and list of nodes 
matrix, list_nodes = n.get_matrix()
print('matrix:',matrix)           # weighted adjacency matrix
print('list nodes:',list_nodes)           # weighted adjacency matrix

# Query the neighbors of node 'a'
in_neighbors = n.in_neighbors('a')
print("In-Neighbors of 'a':", in_neighbors)
out_neighbors = n.out_neighbors('a')
print("Out-Neighbors of 'a':", out_neighbors)

# Get network performances
print('Total Nodes:',n.total_nodes)           # number of nodes
print('Total Links:',n.total_links)           # number of links
print('List of Links:',n.get_links)           # list of  links
print('Total Flow:',n.total_flow)             # total flow
print('Network Entropy:',n.network_entropy)   # network entropy 
print('Coef. Variation of Flow:',n.cov_flow) # coef. variation of flow

# Display the flows
n.show();

For more detailed tutorials and documentation, please visit our official documentation.

Applications

Ideal Flow Networks have been applied in various domains:

  • Transportation Planning: Modeling and optimizing traffic flows.
  • Communication Networks: Analyzing data packet flows and network reliability.
  • Health Science: Understanding the spread of diseases in epidemiology.
  • Ecology: Studying energy and resource flows in ecosystems.
  • Data Science and AI: Enhancing machine learning algorithms with network-based approaches.
  • Systems Thinking and Philosophy: Exploring concepts of interconnectedness and systemic behavior.

Contributing

We welcome contributions from everyone! If you're interested in contributing to the Ideal Flow Network project, here are some ways you can help:

  • Test: Try out the package and let us know if you encounter any issues.
  • Comment and Critique: Provide feedback to help us improve.
  • Use: Incorporate IFN into your projects and share your experiences.
  • Post on Social Media: Spread the word! Share our project on social media platforms.
  • Subscribe: Stay updated by following our channels.

Feel free to pick an issue and help us out! Pull requests are encouraged and always welcome. Check How to Contributing to Ideal Flow Network.

Community and Support

Join our community to connect with other users and contributors:

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.

Sponsors

We greatly appreciate any support to help us continue developing and improving this project. If you wish to support us and prefer a different licensing arrangement, we offer sponsorship opportunities.

Note: The farther away from GPL you want to be, the exponentially more support is required.

Citing Ideal Flow Network

If you use Ideal Flow Network in your research or projects, please consider citing:

Teknomo, K. (2018). Ideal Flow of Markov Chain. Discrete Mathematics, Algorithms and Applications, 10(06), 1850073. doi: 10.1142/S1793830918500738

Example BibTeX entry:

@article{doi:10.1142/S1793830918500738,
author = {Teknomo, Kardi},
title = {Ideal Flow of Markov Chain},
journal = {Discrete Mathematics, Algorithms and Applications},
volume = {10},
number = {06},
pages = {1850073},
year = {2018},
doi = {10.1142/S1793830918500738},
URL = {https://doi.org/10.1142/S1793830918500738},
}

You may also cite any of the publications listed in the Scientific Basis section if you use or improve this Python library.

Scientific Basis

The following publications form the foundation of Ideal Flow Network analysis:

  • Teknomo, K. (2019). Ideal Flow Network in Society 5.0. In Optimization in Large Scale Problems - Industry 4.0 and Society 5.0 Applications, Springer, pp. 67-69.
  • Teknomo, K., & Gardon, R.W. (2019). Traffic Assignment Based on Parsimonious Data: The Ideal Flow Network. 2019 IEEE Intelligent Transportation Systems Conference (ITSC), 1393-1398.
  • Teknomo, K., Gardon, R., & Saloma, C. (2019). Ideal Flow Traffic Analysis: A Case Study on a Campus Road Network. Philippine Journal of Science, 148(1), 51-62.
  • Teknomo, K. (2018). Ideal Flow of Markov Chain. Discrete Mathematics, Algorithms and Applications, 10(06), 1850073.
  • Teknomo, K., & Gardon, R.W. (2017). Intersection Analysis Using the Ideal Flow Model. Proceedings of the IEEE 20th International Conference on Intelligent Transportation Systems.
  • Teknomo, K. (2017). Ideal Relative Flow Distribution on Directed Network. Proceedings of the 12th Eastern Asia Society for Transportation Studies (EASTS).
  • Teknomo, K. (2017). Premagic and Ideal Flow Matrices. arXiv preprint arXiv:1706.08856.
  • Gardon, R.W., & Teknomo, K. (2017). Analysis of the Distribution of Traffic Density Using the Ideal Flow Method and the Principle of Maximum Entropy. Proceedings of the 17th Philippine Computing Science Congress.
  • Teknomo, K. (2015). Ideal Flow Based on Random Walk on Directed Graph. The 9th International Collaboration Symposium on Information, Production and Systems (ISIPS 2015).

Contact

(c) 2024 Kardi Teknomo

For any inquiries or support, please contact Kardi Teknomo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idealflownetwork-1.15.5.tar.gz (73.3 kB view details)

Uploaded Source

Built Distribution

IdealFlowNetwork-1.15.5-py3-none-any.whl (75.2 kB view details)

Uploaded Python 3

File details

Details for the file idealflownetwork-1.15.5.tar.gz.

File metadata

  • Download URL: idealflownetwork-1.15.5.tar.gz
  • Upload date:
  • Size: 73.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for idealflownetwork-1.15.5.tar.gz
Algorithm Hash digest
SHA256 d720316cc9b957b6b0b1cee6fbbaff218bb7b4472c64da6dc1ef49d3b9ed8ce7
MD5 de2fe7cf548e53203cfa96ad68a4464d
BLAKE2b-256 163efe96090eeab2d54bfcd6d064e1434159ab32d451774438302e6162b280e6

See more details on using hashes here.

File details

Details for the file IdealFlowNetwork-1.15.5-py3-none-any.whl.

File metadata

File hashes

Hashes for IdealFlowNetwork-1.15.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6c3c5cf8c8ddc259cf9f3322cb415e13ddab0e5a3f0f92661585983f10c71c48
MD5 2f60fa88679d86b90568773f2c4757fa
BLAKE2b-256 203f0ccbe967d5eca767e4d36a8855f5b5271cf4196cde1c25d79eb83aff00b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page