Abstract
We have already seen numerous examples of arrays and matrices being the essential entities in many aspects of numerical computing. So far we have represented arrays with the NumPy ndarray data structure, which is a heterogeneous representation that stores all the elements of the array that it represents. In many cases, this is the most efficient way to represent an object such as a vector, matrix, or a higher-dimensional array. However, notable exceptions are matrices where most of the elements are zeros. Such matrices are known as sparse matrices, and they occur in many applications, for example, in connection networks (such as circuits) and in large algebraic equation systems that arise, for example, when solving partial differential equations (see Chapter 11 for examples).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
- 3.
See http://www.mcs.anl.gov/petsc and https://bitbucket.org/petsc/petsc4py for its Python bindings.
- 4.
- 5.
For a discussion of techniques and methods to optimize Python code, see Chapter 21.
- 6.
- 7.
- 8.
For more information about the JSON format and the json module, see Chapter 18.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Robert Johansson
About this chapter
Cite this chapter
Johansson, R. (2019). Sparse Matrices and Graphs. In: Numerical Python . Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4246-9_10
Download citation
DOI: https://doi.org/10.1007/978-1-4842-4246-9_10
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-4245-2
Online ISBN: 978-1-4842-4246-9
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)