liveBook · Manning

Embedding

As explained in Classic Computer Science Problems in Swift: Essential techniques for practicing programmers

A vector is an ordered collection of numerical components representing a quantity or point in a mathematical space.

An embedding is an ordered collection of numerical components representing a quantity or point in a mathematical space. The demonstrated weighted-graph design offers a related implementation pattern: a generic numerical type can be compared and added when algorithms need to rank or total values. section 4.3

The adjacent weighted-value pattern requires:

  • Comparison, so values or weighted edges can be ordered. section 4.3
  • Addition, so multiple values can form a combined weight. section 4.3

Numerical values in a weighted graph

A weighted edge can store a generic weight W, such as the distance between two cities. A weighted graph can then report neighbor-and-weight pairs, while algorithms compare individual weights and add them into path or tree totals.

Also explained in

Compare how 47 books explain embedding →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Classic Computer Science Problems in Swift: Essential techniques for practicing programmers. The section links point to the parts of the book it draws on.