Skip to main content

EvoEuler: Evolving Euler and Venn Diagrams with Specific Properties

Project description

EvoEuler: Evolving Euler and Venn Diagrams with Specific Properties

EvoEuler searches for Euler and Venn diagrams with a simple closed shape using a multi-objective evolutionary algorithm. Both a web interface and an application programming interface (API) are available.

EvoEuler allows users to:

  • specify optional constraints (symmetric diagram and congruent shape) before optimization.
  • obtain a set of non-dominated solutions (diagrams), each evaluated with five objectives (missing zone, unwanted zone, triple point, concurrency, and disconnected zone) that quantify the violation of well-matchedness or well-formedness properties.
  • explore trade-offs among non-dominated solutions via parallel coordinates plots that visualize the objective values of all solutions.

Installation

Run the following command to install EvoEuler:

pip install evoeuler

Web Interface

Run the following command to launch the web interface:

evoeuler

EvoEuler Web Interface Compared to the API, the web interface additionally allows users to draw, redraw, round, smooth, or view custom simple closed shapes, which can then be used for diagram generation.

API

The example below shows the use of all functions provided by the API.

The supported algorithms for the API are: NSGA-II and NSGA-III.

The supported shapes for the API are: circle, ellipse, rectangle, rounded_rectangle, equilateral_triangle, rounded_equilateral_triangle, square, rounded_square, pentagon, rounded_pentagon, hexagon, rounded_hexagon, heptagon, rounded_heptagon, octagon, rounded_octagon, nonagon, rounded_nonagon, decagon, and rounded_decagon.

Note that if symmetric is set to True, congruent will be automatically set to True.

"""Search for symmetric Venn-3 diagrams with congruent ellipses."""

import matplotlib.pyplot as plt

from evoeuler import diagram, obj_values, optimize, pcp, shape_params, zone_info

if __name__ == "__main__":
    # Start an optimization.
    result = optimize(
        zones={"A", "B", "C", "A B", "A C", "B C", "A B C"},
        shape="ellipse",
        algorithm="NSGA-II",
        n_gen=100,
        n_process=1,
        time=None,
        symmetric=True,
        congruent=True,
    )

    # Print the number of non-dominated solutions.
    print(f"Number of non-dominated solutions: {len(result)}")

    # Show the parallel coordinates plot that visualizes the objective values
    # of all non-dominated solutions.
    fig = pcp(result)
    fig.show()

    solution_idx = 0  # Solution index

    # Show the diagram of a non-dominated solution.
    diagram(
        result[solution_idx], show_zone_labels=False, shade_unwanted_zones=True
    )
    plt.show()

    # Print the objective values of a non-dominated solution.
    print("Objective values:")
    print(obj_values(result[solution_idx]))

    # Print the zone information of a non-dominated solution.
    print("Zone info:")
    print(zone_info(result[solution_idx]))

    # Print the shape parameters of a non-dominated solution.
    print("Shape params:")
    print(shape_params(result[solution_idx]))

Examples

Some example scripts for searching Euler or Venn diagrams are in ./examples.

Contact

If you have any questions, please contact Chi Ho Chan at c.chan3@napier.ac.uk.

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

evoeuler-1.0.1.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

evoeuler-1.0.1-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file evoeuler-1.0.1.tar.gz.

File metadata

  • Download URL: evoeuler-1.0.1.tar.gz
  • Upload date:
  • Size: 36.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for evoeuler-1.0.1.tar.gz
Algorithm Hash digest
SHA256 468889aec94a0787d1cef7956fcafb2ac6b8c5746915759183ae3a1e5e1c0a8f
MD5 4efb0faa28ec6827c2e453cc4b4f7349
BLAKE2b-256 ef6ef7a800fd62d076275891afd582e42481860c6048cbb2859804ba0ccc0bcb

See more details on using hashes here.

File details

Details for the file evoeuler-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: evoeuler-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for evoeuler-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 102cdf2ed84e0edd39ae0d461f10131178751daff4052c2e201f8ff400407cf1
MD5 7cc0306d7bfca6d9c53f0c2f65685a43
BLAKE2b-256 deb3e49e379910952ad68f14690f0943917c12464e0b73e1efb8f6315697da06

See more details on using hashes here.

Supported by

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