A class consists of 26 students with two students sitting on each desk. Suddenly, the students decide to change seats, such that every two students that were previously sitting together are now apart. Find the maximum value of positive integer $N$ such that, regardless of the students' sitting positions, at the end there is a set $S$ consisting of $N$ students satisfying the following property: every  two of them have never been sitting together.
1. **Model the Problem as a Graph:**
   - Consider each student as a vertex in a graph \( G \).
   - Each desk with two students sitting together can be represented as an edge between two vertices.
   - Since there are 26 students and each desk has 2 students, we have 13 edges in the graph.

2. **Graph Properties:**
   - The graph \( G \) is a 2-regular graph because each vertex (student) is connected to exactly two other vertices (students they have sat with).
   - We need to ensure that after the students change seats, no two students who were previously sitting together are now sitting together.

3. **Bipartite Graph Argument:**
   - A 2-regular graph can be decomposed into two perfect matchings (one for each seating arrangement).
   - We claim that \( G \) is bipartite. A bipartite graph is a graph whose vertices can be divided into two disjoint sets such that no two graph vertices within the same set are adjacent.

4. **Proof of Bipartiteness:**
   - Assume for contradiction that \( G \) is not bipartite. Then \( G \) contains an odd cycle.
   - In a 2-regular graph, an odd cycle would imply that there is a vertex with two edges of the same color (representing the same seating arrangement), which contradicts the problem's conditions.
   - Therefore, \( G \) must be bipartite.

5. **Partitioning the Graph:**
   - Since \( G \) is bipartite, we can partition the vertices into two sets \( A \) and \( B \) such that no two vertices within the same set are adjacent.
   - Each set \( A \) and \( B \) will have equal sizes because the graph is 2-regular and has an even number of vertices (26 vertices).

6. **Conclusion:**
   - The maximum value of \( N \) such that there exists a set \( S \) of \( N \) students where no two students in \( S \) have ever sat together is the size of one of the bipartite sets.
   - Since the graph is bipartite and has 26 vertices, each set \( A \) and \( B \) will have \( \frac{26}{2} = 13 \) vertices.

The final answer is \( \boxed{13} \).