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.0.tar.gz (37.0 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.0-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for evoeuler-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0fee9a589edd4279aac02e2463f4044b3bf9ae08fcaf64c2ab1a9d38014671b3
MD5 88dce3856d04a905520222161b733ab6
BLAKE2b-256 7617384e9fa514a3052f4237bda4cacc2de72ceb7574f2997ebd42d8b725f619

See more details on using hashes here.

File details

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

File metadata

  • Download URL: evoeuler-1.0.0-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.10.19

File hashes

Hashes for evoeuler-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3b48eb592c0c94b9d7c8d3b5a8461f4023d8cf4165d1db197a4a19d09090646
MD5 ab08494029e7d90d779e613f059e7e5e
BLAKE2b-256 8ffcd19157d76f102df6b4019d8fac06ceed8fb180623b0ed45710c1d85a26a4

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