Skip to main content

An Approach to Geometric Modeling Using Genetic Programming

  • Conference paper
  • First Online:
Computers and Devices for Communication (CODEC 2019)

Part of the book series: Lecture Notes in Networks and Systems ((LNNS,volume 147))

Included in the following conference series:

  • 593 Accesses

Abstract

In this work, we ‘derived’ the famous Pythagorean theorem from the measurements of the sides of right-angled triangles with machine learning. In classical Euclidean geometry, this result is proved with rigorous geometrical argument, but we have followed a data-driven approach and got the same result without entering a single step in the domain of geometry. We used symbolic regression with genetic programming to reach the model. As far as our knowledge goes, this result is a novel one and may open up a new avenue of applying machine learning tool in geometry. We have used Python programming language 3.7 and libraries such as DEAP (v1.2) and pygraphviz. The whole project can be found on https://github.com/snigdhasjg/Pythagorean-Triplate.git.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 189.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 249.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Holland, J.H.: Adaptation in Natural and Artificial Systems.: University of Michigan Press, Ann Arbor (1975)

    Google Scholar 

  2. Gen, M., Cheng, R.: Genetic Algorithms and Engineering Design. Wiley, New York (1997)

    Google Scholar 

  3. Holland's schema theorem

    Google Scholar 

  4. Human-competitive results produced by genetic programming by John R Koza

    Google Scholar 

  5. Smits, G., Kotanchek, M. : Pareto-front exploitation in symbolic regression. In: Genetic Programming Theory and Practice II. Springer, Ann Arbor, pp 283–299 (2004)

    Google Scholar 

  6. Martí, R., Resende, M.G.C., Ribeiro, C.C.: Multi-start methods for combinatorial optimization. Eur. J. Oper. Res. 226(1), 1–8 (2013)

    Article  MathSciNet  Google Scholar 

  7. Dao, S.D., Abhary, K., Marian, R.: An Adaptive Restarting Genetic Algorithm for Global Optimization

    Google Scholar 

  8. Vladislavleva, E.J., Smits, G.F., Hertog, D.: Order of nonlinearity as a complexity measure for models generated by symbolic regression via pareto genetic programming. In: IEEE Trans. Evolut. Comput. 13(2), 334 (2009)

    Google Scholar 

  9. Kessaci, Y., et al.: Parallel evolutionary algorithms for energy aware scheduling. In: Bouvry, P., González-Vélez, H., Kołodziej, J. (eds.) Intelligent Decision Systems in Large-Scale Distributed Environments, pp. 75–100. Springer, Berlin (2011)

    Chapter  Google Scholar 

  10. Dao, S.D., Abhary, K., Marian, R.: Optimisation of partner selection and collaborative transportation scheduling in virtual enterprises using GA. Expert Syst. Appl. 41(15), 6701–6717 (2014)

    Article  Google Scholar 

  11. Purohit, A., Choudhari, N.S., Tiwari, A.: Code Bloat Problem in Genetic Programming

    Google Scholar 

  12. Trujillo, L., Naredo, E., Martínez, Y.: Preliminary Study of Bloat in Genetic Programming with Behaviour-Based Search

    Google Scholar 

  13. Koza, J.R.: Genetic Programming: On the Programming of Computers by Means of Natural Selection (Chap. 6), p 114

    Google Scholar 

  14. Dignum, S., Poli, R.: Operator Equalisation and Bloat Free GP

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Snigdhajyoti Ghosh .

Editor information

Editors and Affiliations

Appendix

Appendix

The algorithm gives output as string representation of tree like \(power\left( {add\left( {mul\left( {A,A} \right),mul\left( {B,B} \right)} \right),1,2} \right)\) that can be expressed as \(\sqrt {A^{2} + B^{2} }\). In Fig. 5, the same equation is represented as tree.

Fig. 5
figure 5

A typical tree structure of Pythagorean equation

Not every time this algorithm gives the same result. Some non-trivial and apparently complicated trees which finally leads to the Pythagorean theorem are:

  • power(add(mul(A,A),mul(B,B)),1,2)

  • power(add(mul(B,B),mul(A,A)),2,4)

  • power(add(mul(B,B),mul(A,A)),3,6)

  • power(add(mul(B,B),mul(A,A)),4,8)

  • power(add(mul(A,A),mul(B,B)),5,10)

  • power(add(mul(A,A),power(B,8,4)),1,2)

  • power(add(power(A,8,4),mul(B,B)),2,4)

  • power(add(power(A,4,2),mul(B,B)),5,10)

  • power(add(sub(mul(A,A),sub(A,A)),mul(B,B)),1,2)

  • power(add(sub(A,A),add(mul(A,A),mul(B,B))),1,2)

  • power(add(mul(power(B,4,2),safe_div(A,A)),add(mul(A,A),sub(B,B))),4,8)

  • power(sub(add(mul(A,A),sub(A,B)),sub(sub(A,B),mul(B,B))),5,10)

  • power(add(mul(B,B),mul(A,power(power(A,4,3),3,4))),3,6)

  • power(sub(mul(add(B,A),A),sub(mul(B,A),mul(B,B))),2,4)

  • add(power(add(add(mul(B,B),sub(A,A)),mul(A,A)),2,4),safe_div(A,add(mul(B,B),

    mul(power(B,10,10),A))))

  • power(add(add(mul(A,A),mul(B,B)),safe_div(add(B,A),power(B,5,1))),4,8)

1.1 Run Results

We have achieved 8 successful runs out of 10 test runs. The results are as follows.

  1. 1.

    power(add(mul(A, A), mul(B, B)), 1, 2)

  2. 2.

    power(add(mul(B, B), mul(A, A)), 3, 6)

  3. 3.

    power(sub(mul(B, B), sub(safe_div(power(B, 3, 5), mul(B, B)), mul(A, A))), 4, 8)

  4. 4.

    power(sub(add(mul(A, A), mul(B, B)), safe_div(sub(B, B), A)), 2, 4)

  5. 5.

    power(add(mul(A, A), add(sub(B, B), mul(B, B))), 4, 8)

  6. 6.

    power(mul(add(mul(A, A), power(B, 6, 3)), add(mul(A, A), power(B, 6, 3))), 2, 8)

  7. 7.

    power(add(mul(A, A), mul(B, B)), 4, 8)

  8. 8.

    power(add(mul(A, A), mul(B, B)), 5, 10)

All these generated trees are having fitness value near 0, i.e., 0.0407. This small error is due to choosing input points as floating number.

And the other 2 unsuccessful runs are:

  1. 1.

    add(B, safe_div(add(power(A, 5, 6), mul(A, A)), add(safe_div(mul(A, A), add(A, B)), add(B, B))))

which has fitness value of 3.795.

  1. 2.

    add(B, safe_div(safe_div(add(mul(B, A), B), safe_div(B, A)), add(add(A, B), safe_div(mul(B, B), add(B, A)))))

which has fitness value of 3.816.

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Ghosh, S., Goswami, D., Datta, C.R. (2021). An Approach to Geometric Modeling Using Genetic Programming. In: Das, N.R., Sarkar, S. (eds) Computers and Devices for Communication. CODEC 2019. Lecture Notes in Networks and Systems, vol 147. Springer, Singapore. https://doi.org/10.1007/978-981-15-8366-7_13

Download citation

  • DOI: https://doi.org/10.1007/978-981-15-8366-7_13

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-15-8365-0

  • Online ISBN: 978-981-15-8366-7

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics